Kaynağa Gözat

用户添加标签的接口修改

release_toaliyun_real
jinguo24@163.com 7 yıl önce
ebeveyn
işleme
5bba7f35b9
2 değiştirilmiş dosya ile 45 ekleme ve 9 silme
  1. +23
    -9
      mallinkAdmin/src/main/java/com/simple/controller/WxCUserBasicInfoController.java
  2. +22
    -0
      mallinkService/src/main/java/com/simple/domain/po/WxCUserBasicInfo.java

+ 23
- 9
mallinkAdmin/src/main/java/com/simple/controller/WxCUserBasicInfoController.java Dosyayı Görüntüle

@@ -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();
} }


+ 22
- 0
mallinkService/src/main/java/com/simple/domain/po/WxCUserBasicInfo.java Dosyayı Görüntüle

@@ -81,6 +81,28 @@ public class WxCUserBasicInfo implements Serializable {
/*商户id**/ /*商户id**/
@io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId")
private Long merchantId; private Long merchantId;
@io.swagger.annotations.ApiModelProperty(value="标签-传json",name="tags")
@Transient
private String tags ;
public Long getcUserId() {
return cUserId;
}

public void setcUserId(Long cUserId) {
this.cUserId = cUserId;
}

public String getTags() {
return tags;
}

public void setTags(String tags) {
this.tags = tags;
}

public String getPhone() { public String getPhone() {
return phone; return phone;
} }


Yükleniyor…
İptal
Kaydet