8 changed files with 188 additions and 3 deletions
@ -0,0 +1,45 @@ |
|||
package com.ccsens.datacentre.api; |
|||
|
|||
import com.ccsens.datacentre.bean.dto.UserDto; |
|||
import com.ccsens.datacentre.bean.vo.DomainVo; |
|||
import com.ccsens.util.JsonResponse; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "domain" , description = "域信息相关接口") |
|||
@RestController |
|||
@RequestMapping("/domain") |
|||
@Slf4j |
|||
public class DomainController { |
|||
|
|||
@ApiOperation(value = "查询用户关联的域列表", notes = "") |
|||
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse<List<DomainVo.DomainInfo>> queryDomainByPt(@ApiParam @Validated @RequestBody UserDto.PhoneAndIdCard params) throws Exception{ |
|||
log.info("PT查询用户关联的域列表:{}",params); |
|||
|
|||
log.info("PT查询用户关联的域列表返回:{}",params); |
|||
return JsonResponse.newInstance().ok(); |
|||
} |
|||
//
|
|||
// @ApiOperation(value = "查询用户关联的域列表(数据中心互相调用)", notes = "")
|
|||
// @RequestMapping(value = "/queryByIdc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
|
|||
// public JsonResponse<List<DomainVo.DomainInfo>> queryDomainByIdc(@ApiParam @Validated @RequestBody UserDto.PhoneAndIdCard params) throws Exception{
|
|||
// log.info("数据中心查询用户关联的域列表:{}",params);
|
|||
//
|
|||
// log.info("数据中心查询用户关联的域列表返回:{}",params);
|
|||
// return JsonResponse.newInstance().ok();
|
|||
// }
|
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.ccsens.datacentre.api; |
|||
|
|||
import com.ccsens.util.JsonResponse; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "heartbeat" , description = "域信息相关接口") |
|||
@RestController |
|||
@RequestMapping("/heartbeat") |
|||
@Slf4j |
|||
public class HeartbeatController { |
|||
|
|||
@ApiOperation(value = "发送心跳", notes = "") |
|||
@RequestMapping(value = "/out", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse outHeartbeat() throws Exception{ |
|||
|
|||
log.info("发送心跳成功"); |
|||
return JsonResponse.newInstance().ok(); |
|||
} |
|||
|
|||
@ApiOperation(value = "接收私域的心跳", notes = "") |
|||
@RequestMapping(value = "/in", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse inHeartbeat(@RequestParam(required = true) String code) throws Exception{ |
|||
|
|||
log.info("接收私域的心跳"); |
|||
return JsonResponse.newInstance().ok(); |
|||
} |
|||
} |
@ -0,0 +1,42 @@ |
|||
package com.ccsens.datacentre.api; |
|||
|
|||
import com.ccsens.datacentre.bean.dto.UserDto; |
|||
import com.ccsens.util.JsonResponse; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import io.swagger.annotations.ApiParam; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Api(tags = "user" , description = "用户信息相关接口") |
|||
@RestController |
|||
@RequestMapping("/user") |
|||
@Slf4j |
|||
public class UserController { |
|||
|
|||
|
|||
@ApiOperation(value = "tall调用数据中心添加用户", notes = "") |
|||
@RequestMapping(value = "/saveUserByTall", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse saveUserByTall(@ApiParam @Validated @RequestBody UserDto.DomainUser params) throws Exception{ |
|||
log.info("tall调用数据中心添加用户:{}",params); |
|||
|
|||
log.info("tall调用数据中心添加用户成功"); |
|||
return JsonResponse.newInstance().ok(); |
|||
} |
|||
|
|||
@ApiOperation(value = "私域调用公域数据中心添加用户", notes = "") |
|||
@RequestMapping(value = "/saveUserByIdc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|||
public JsonResponse saveUserByIdc(@ApiParam @Validated @RequestBody UserDto.DomainUser params) throws Exception{ |
|||
log.info("私域调用公域数据中心添加用户:{}",params); |
|||
|
|||
log.info("私域调用公域数据中心添加用户成功"); |
|||
return JsonResponse.newInstance().ok(); |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.ccsens.datacentre.bean.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Data |
|||
public class UserDto { |
|||
|
|||
@Data |
|||
@ApiModel("用户身份证和手机号") |
|||
public static class PhoneAndIdCard{ |
|||
@ApiModelProperty("手机号") |
|||
private String phone; |
|||
@ApiModelProperty("身份证号") |
|||
private String idCard; |
|||
} |
|||
|
|||
@Data |
|||
@ApiModel("域内用户信息") |
|||
public static class DomainUser{ |
|||
@ApiModelProperty("手机号") |
|||
private String name; |
|||
@ApiModelProperty("身份证号") |
|||
private String code; |
|||
@ApiModelProperty("身份证号") |
|||
private String domainName; |
|||
@ApiModelProperty("身份证号") |
|||
private List<PhoneAndIdCard> userList; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.ccsens.datacentre.bean.vo; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author 逗 |
|||
*/ |
|||
@Data |
|||
public class DomainVo { |
|||
|
|||
@Data |
|||
@ApiModel("域信息") |
|||
public static class DomainInfo{ |
|||
@ApiModelProperty("域id") |
|||
private Long id; |
|||
@ApiModelProperty("身份证号") |
|||
private String name; |
|||
@ApiModelProperty("域code") |
|||
private String code; |
|||
@ApiModelProperty("域名(网址)") |
|||
private String domainName; |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue