Commit 7ce1b9da authored by zengtianlai3's avatar zengtianlai3

Merge branch 'm33' into 'master'

增加Resource下载

See merge request !17
parents 512f3299 3857c8b5
......@@ -38,11 +38,12 @@ public class OperateSAMStatusResponseEventHandler {
onlineCount++;
}
}
SamMonitor samMonitor = new SamMonitor();
samMonitor.setServerIp(serverIp);
samMonitor.setOnlineCount(onlineCount);
samMonitor.setSamCount(samCount);
operateManager.putSamMonitorMap(serverIp, samMonitor);
int allSamCount = 0;
int allOnlineCount = 0;
}
}
package iot.sixiang.license.mapper;
import iot.sixiang.license.model.vo.ResourceVo;
import java.util.List;
/**
* Created by m33 on 2022/6/10 16:22
*/
public interface ResourceMapper {
List<ResourceVo> getResource(int userId);
}
package iot.sixiang.license.model.vo;
import lombok.Data;
/**
* Created by m33 on 2022/6/10 16:17
*/
@Data
public class ResourceVo {
private String userName;
private String password;
private String company;
private String appName;
private String appKey;
private String sn;
}
\ No newline at end of file
package iot.sixiang.license.service;
import iot.sixiang.license.model.vo.ResourceVo;
import java.util.List;
/**
* Created by m33 on 2022/6/10 16:15
*/
public interface ResourceService {
List<ResourceVo> getResource(int userId);
}
package iot.sixiang.license.service.impl;
import iot.sixiang.license.handler.IotLicenseException;
import iot.sixiang.license.mapper.ResourceMapper;
import iot.sixiang.license.model.vo.ResourceVo;
import iot.sixiang.license.service.ResourceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by m33 on 2022/6/10 16:20
*/
@Service
public class ResourceServiceImpl implements ResourceService {
@Resource
private ResourceMapper resourceMapper;
@Override
public List<ResourceVo> getResource(int userId) {
if (userId == 0) {
throw new IotLicenseException(400, "用户Id不能为空");
}
List<ResourceVo> record = resourceMapper.getResource(userId);
return record;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="iot.sixiang.license.mapper.ResourceMapper">
<select id="getResource" resultType="iot.sixiang.license.model.vo.ResourceVo">
SELECT a.user_name,a.password,a.company,b.app_name,b.app_key,c.sn
FROM USER a, apply b, device c WHERE a.user_id = b.user_id
AND b.app_id = c.app_id AND a.user_id = #{userId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment