Commit 9ff714a3 by 裴大威

Merge branch 'zcy-add-service' into 'master'

add service updateGenerationMachineIp

See merge request rays/pcloud-book!187
parents 1f52018a b7e27082
...@@ -91,6 +91,8 @@ public interface WeixinQrcodeService { ...@@ -91,6 +91,8 @@ public interface WeixinQrcodeService {
@RequestMapping(value = "getWxGroupInfoByIds", method = RequestMethod.POST) @RequestMapping(value = "getWxGroupInfoByIds", method = RequestMethod.POST)
ResponseEntity<ResponseDto<Map<Long, GroupQrcodeInfo4Advertising>>> getWxGroupInfoByIds(@RequestBody List<Long> qrcodeIds); ResponseEntity<ResponseDto<Map<Long, GroupQrcodeInfo4Advertising>>> getWxGroupInfoByIds(@RequestBody List<Long> qrcodeIds);
@ApiOperation(value = "修改模拟器IP地址", httpMethod = "GET")
@RequestMapping(value = "updateGenerationMachineIp", method = RequestMethod.GET)
void updateGenerationMachineIp(@RequestParam("generation") Integer generation, @RequestParam("machineIp") String machineIp);
} }
...@@ -134,4 +134,6 @@ public interface WeixinQrcodeBiz { ...@@ -134,4 +134,6 @@ public interface WeixinQrcodeBiz {
void inviteNewRobot(String wxUserId); void inviteNewRobot(String wxUserId);
Map<String, BookWxQrcodeDTO> getGroupVersion(List<String> wxGroupIds); Map<String, BookWxQrcodeDTO> getGroupVersion(List<String> wxGroupIds);
void updateGenerationMachineIp(Integer generation, String machineIp);
} }
...@@ -425,6 +425,14 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz { ...@@ -425,6 +425,14 @@ public class WeixinQrcodeBizImpl implements WeixinQrcodeBiz {
return weixinQrcodeDao.listByWxGroupIds(wxGroupIds) == null ? new HashMap<>() : weixinQrcodeDao.listByWxGroupIds(wxGroupIds); return weixinQrcodeDao.listByWxGroupIds(wxGroupIds) == null ? new HashMap<>() : weixinQrcodeDao.listByWxGroupIds(wxGroupIds);
} }
@Override
public void updateGenerationMachineIp(Integer generation, String machineIp) {
if (null == generation || StringUtil.isEmpty(machineIp)) {
return;
}
weixinQrcodeDao.updateGenerationMachineIp(generation, machineIp);
}
private void updateQrUrlVIP(List<UpdateQrDTO> updateQrs) { private void updateQrUrlVIP(List<UpdateQrDTO> updateQrs) {
if (ListUtils.isEmpty(updateQrs)) { if (ListUtils.isEmpty(updateQrs)) {
return; return;
......
...@@ -168,4 +168,6 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> { ...@@ -168,4 +168,6 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> {
* 根据状态获取群数量 * 根据状态获取群数量
*/ */
Integer countByState(Integer state, List<String> altIds); Integer countByState(Integer state, List<String> altIds);
void updateGenerationMachineIp(Integer generation, String machineIp);
} }
...@@ -174,4 +174,12 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We ...@@ -174,4 +174,12 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We
paramMap.put("altIds", altIds); paramMap.put("altIds", altIds);
return this.getSessionTemplate().selectOne("countByState", paramMap); return this.getSessionTemplate().selectOne("countByState", paramMap);
} }
@Override
public void updateGenerationMachineIp(Integer generation, String machineIp) {
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("generation", generation);
paramMap.put("machineIp", machineIp);
this.getSessionTemplate().update(getStatement("updateGenerationMachineIp"), paramMap);
}
} }
...@@ -143,4 +143,10 @@ public class WeixinQrcodeServiceImpl implements WeixinQrcodeService { ...@@ -143,4 +143,10 @@ public class WeixinQrcodeServiceImpl implements WeixinQrcodeService {
return ResponseHandleUtil.toResponse(wechatGroupInfoMap); return ResponseHandleUtil.toResponse(wechatGroupInfoMap);
} }
@Override
@RequestMapping(value = "updateGenerationMachineIp", method = RequestMethod.GET)
public void updateGenerationMachineIp(@RequestParam("generation") Integer generation, @RequestParam("machineIp") String machineIp) {
weixinQrcodeBiz.updateGenerationMachineIp(generation, machineIp);
}
} }
...@@ -302,4 +302,8 @@ ...@@ -302,4 +302,8 @@
</foreach> </foreach>
and use_state=#{state} and use_state=#{state}
</select> </select>
<update id="updateGenerationMachineIp" parameterType="map">
update weixin_qrcode_generation set virtual_machine_ip = #{machineIp} where generation = #{generation}
</update>
</mapper> </mapper>
\ No newline at end of file
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