提交 f9890d10 编写于 作者: 江陈's avatar 江陈

perf:加入合作机构自动开saas账号

注册、修改saas账号信息逻辑调整
上级 71e4f638
流水线 #47661 已失败 于阶段
......@@ -39,8 +39,8 @@ public interface RegisterClient {
PicaResponse<LoginResult> loginRegister(@RequestBody EncryptEntity entity);
@PostMapping("/account/saas/hospital/registerV2")
PicaResponse<Integer> registerV2(@RequestBody HospitalSaasUserReq req, @RequestHeader("token") String token);
PicaResponse<Integer> registerV2(@RequestBody HospitalSaasUserReq req);
@PostMapping("/account/saas/hospital/upsert")
@PostMapping("/account/saas/hospital/upsertV2")
PicaResponse<Integer> upsert(@RequestBody HospitalSaasUserReq req);
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import com.pica.cloud.account.account.server.service.HospitalSaasRoleService;
import com.pica.cloud.account.account.server.service.HospitalSaasUserService;
import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.service.starter.interceptor.EnabledLoginValidate;
import com.pica.cloud.foundation.utils.entity.PicaUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
......@@ -45,20 +46,33 @@ public class HospitalSaasUserController extends AccountBaseController {
@ApiOperation("机构saas平台人员注册 0失败 1成功 (密码可为空)")
@PostMapping(value = "/hospital/registerV2")
public PicaResponse<Integer> registerV2(@RequestBody HospitalSaasUserReq req, @RequestHeader("token") String token) {
public PicaResponse<Integer> registerV2(@RequestBody HospitalSaasUserReq req) {
logger.info("register: url:/saas/hospital/registerV2. start: {}", JSON.toJSONString(req));
req.checkInsertParamsNoPassWord();
return PicaResponse.toResponse(hospitalSaasUserService.register(req, super.fetchPicaUser()));
PicaUser user = new PicaUser();
user.setId(0);
return PicaResponse.toResponse(hospitalSaasUserService.register(req, user));
}
@ApiOperation("机构saas平台人员更新 0失败 1成功")
@PostMapping(value = "/hospital/upsert")
@EnabledLoginValidate
public PicaResponse<Integer> upsert(@RequestBody HospitalSaasUserReq req) {
logger.info("upsert: url:/saas/hospital/upsert. start: {}", JSON.toJSONString(req));
return PicaResponse.toResponse(hospitalSaasUserService.upsert(req, super.fetchPicaUser()));
}
@ApiOperation("机构saas平台人员更新 0失败 1成功")
@PostMapping(value = "/hospital/upsertV2")
@EnabledLoginValidate
public PicaResponse<Integer> upsertV2(@RequestBody HospitalSaasUserReq req) {
logger.info("upsert: url:/saas/hospital/upsertV2. start: {}", JSON.toJSONString(req));
PicaUser user = new PicaUser();
user.setId(0);
return PicaResponse.toResponse(hospitalSaasUserService.upsert(req, user));
}
@ApiOperation("机构saas平台人员列表查询")
@PostMapping(value = "/hospital/list")
@EnabledLoginValidate
......
......@@ -250,10 +250,6 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
delRoleIdList.addAll(Arrays.asList(SaasRoleEnum.MAIN_ADMIN_ROLE.getCode(), SaasRoleEnum.ADMIN_ROLE.getCode(), SaasRoleEnum.SAAS_MAIN_ADMIN.getCode()));
}
if (null == picaUser) {
picaUser = new PicaUser();
picaUser.setId(0);
}
if (CollectionUtils.isNotEmpty(inputRoleIdList)) {
Map<String, Object> map = new HashMap(3);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册