Explorar el Código

[商铺管理][修改][添加编辑返回值]

release_toaliyun_real
gongbiao hace 7 años
padre
commit
e43f32c669
Se han modificado 3 ficheros con 9 adiciones y 9 borrados
  1. +2
    -4
      mallinkAdmin/src/main/java/com/iformall/controller/WxShopController.java
  2. +3
    -3
      mallinkService/src/main/java/com/iformall/service/WxShopService.java
  3. +4
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java

+ 2
- 4
mallinkAdmin/src/main/java/com/iformall/controller/WxShopController.java Ver fichero

@@ -41,15 +41,13 @@ public class WxShopController extends BaseController {
@PostMapping("add") @PostMapping("add")
public ResultData add(@RequestBody WxShop wxShop) { public ResultData add(@RequestBody WxShop wxShop) {
wxShop.setTenantId(getTenantId()); wxShop.setTenantId(getTenantId());
wxShopService.saveOrUpdate(wxShop);
return new ResultData();
return wxShopService.saveOrUpdate(wxShop);
} }


@ApiOperation("根据id更新接口") @ApiOperation("根据id更新接口")
@PostMapping("update") @PostMapping("update")
public ResultData update(@RequestBody WxShop wxShop) { public ResultData update(@RequestBody WxShop wxShop) {
wxShopService.saveOrUpdate(wxShop);
return new ResultData();
return wxShopService.saveOrUpdate(wxShop);
} }


@ApiOperation("根据id删除接口") @ApiOperation("根据id删除接口")


+ 3
- 3
mallinkService/src/main/java/com/iformall/service/WxShopService.java Ver fichero

@@ -30,9 +30,9 @@ public interface WxShopService {
/** /**
* 保存或更新实体 * 保存或更新实体
* *
* @param record
*/
void saveOrUpdate(WxShop record);
* @param record
*/
ResultData saveOrUpdate(WxShop record);


/** /**
* 根据Id删除实体 * 根据Id删除实体


+ 4
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java Ver fichero

@@ -5,6 +5,7 @@ import java.util.stream.Collectors;


import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.Result;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.domain.po.WxShop; import com.iformall.domain.po.WxShop;
import com.iformall.enums.EnumShopStatus; import com.iformall.enums.EnumShopStatus;
@@ -44,8 +45,7 @@ public class WxShopServiceImpl implements WxShopService {
} }


@Override @Override
public void saveOrUpdate(WxShop record) {

public ResultData saveOrUpdate(WxShop record) {
if (record.getId() == null) { if (record.getId() == null) {
final IdWorker idWorker = IdWorker.get(); final IdWorker idWorker = IdWorker.get();
record.setId(idWorker.nextId()); record.setId(idWorker.nextId());
@@ -54,9 +54,11 @@ public class WxShopServiceImpl implements WxShopService {
record.setUpdateDate(date); record.setUpdateDate(date);
record.setCreateDate(date); record.setCreateDate(date);
wxShopMapper.insertSelective(record); wxShopMapper.insertSelective(record);
return new ResultData(Result.SUCCESS,"添加成功");
} else { } else {
record.setUpdateDate(new Date()); record.setUpdateDate(new Date());
wxShopMapper.updateByPrimaryKeySelective(record); wxShopMapper.updateByPrimaryKeySelective(record);
return new ResultData(Result.SUCCESS,"更新成功");
} }
} }




Cargando…
Cancelar
Guardar