|
|
@@ -1,5 +1,6 @@ |
|
|
package com.simple.controller; |
|
|
package com.simple.controller; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.log4j.Logger; |
|
|
import org.apache.log4j.Logger; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
@@ -9,11 +10,14 @@ import org.springframework.web.bind.annotation.RequestBody; |
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.github.pagehelper.PageInfo; |
|
|
import com.simple.common.Result; |
|
|
import com.simple.common.Result; |
|
|
import com.simple.common.ResultData; |
|
|
import com.simple.common.ResultData; |
|
|
import com.simple.domain.po.WxCUserBasicInfo; |
|
|
import com.simple.domain.po.WxCUserBasicInfo; |
|
|
|
|
|
import com.simple.domain.po.WxCUserTags; |
|
|
import com.simple.service.WxCUserBasicInfoService; |
|
|
import com.simple.service.WxCUserBasicInfoService; |
|
|
|
|
|
import com.simple.service.WxCUserTagsService; |
|
|
|
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.Api; |
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
@@ -27,6 +31,9 @@ public class WxCUserBasicInfoController extends BaseController |
|
|
{ |
|
|
{ |
|
|
@Autowired |
|
|
@Autowired |
|
|
private WxCUserBasicInfoService wxCUserBasicInfoService; |
|
|
private WxCUserBasicInfoService wxCUserBasicInfoService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private WxCUserTagsService wxCUserTagsService; |
|
|
|
|
|
|
|
|
private Logger logger = Logger.getLogger(WxCUserBasicInfoController.class); |
|
|
private Logger logger = Logger.getLogger(WxCUserBasicInfoController.class); |
|
|
|
|
|
|
|
|
@@ -42,20 +49,27 @@ public class WxCUserBasicInfoController extends BaseController |
|
|
return new ResultData(page); |
|
|
return new ResultData(page); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ApiOperation("新增接口") |
|
|
|
|
|
@PostMapping("add") |
|
|
|
|
|
public ResultData add(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { |
|
|
|
|
|
//Assert.notNull(wxCUserBasicInfo.getName(), "角色名不能为空"); |
|
|
|
|
|
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
|
|
wxCUserBasicInfo.setTenantId(getTenantId()); |
|
|
|
|
|
wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); |
|
|
|
|
|
return new ResultData(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// @ApiOperation("新增接口") |
|
|
|
|
|
// @PostMapping("add") |
|
|
|
|
|
// public ResultData add(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { |
|
|
|
|
|
// //Assert.notNull(wxCUserBasicInfo.getName(), "角色名不能为空"); |
|
|
|
|
|
// //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); |
|
|
|
|
|
// wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); |
|
|
|
|
|
// return new ResultData(); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
@ApiOperation("根据id更新接口") |
|
|
@ApiOperation("根据id更新接口") |
|
|
@PostMapping("update") |
|
|
@PostMapping("update") |
|
|
public ResultData update(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { |
|
|
public ResultData update(@RequestBody WxCUserBasicInfo wxCUserBasicInfo) { |
|
|
wxCUserBasicInfo.setTenantId(getTenantId()); |
|
|
wxCUserBasicInfo.setTenantId(getTenantId()); |
|
|
|
|
|
if(StringUtils.isNotBlank(wxCUserBasicInfo.getTags())) { |
|
|
|
|
|
WxCUserTags record =new WxCUserTags(); |
|
|
|
|
|
record.setUserId(wxCUserBasicInfo.getcUserId()); |
|
|
|
|
|
record.setTenantId(getTenantId()); |
|
|
|
|
|
record.setTags(JSON.toJSONString(wxCUserBasicInfo.getTags())); |
|
|
|
|
|
wxCUserTagsService.saveOrUpdate(record); |
|
|
|
|
|
wxCUserBasicInfo.setTagId(record.getId()); |
|
|
|
|
|
} |
|
|
wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); |
|
|
wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); |
|
|
return new ResultData(); |
|
|
return new ResultData(); |
|
|
} |
|
|
} |
|
|
|