package cn.lili.controller.lmk;
|
|
import cn.lili.base.Result;
|
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.group.Add;
|
import cn.lili.group.Update;
|
import cn.lili.modules.lmk.domain.form.CustomerTagForm;
|
import cn.lili.modules.lmk.domain.form.CustomerTagRefForm;
|
import cn.lili.modules.lmk.domain.query.CustomerQuery;
|
import cn.lili.modules.lmk.domain.query.CustomerTagQuery;
|
import cn.lili.modules.lmk.service.CustomerService;
|
import cn.lili.modules.lmk.service.CustomerTagRefService;
|
import cn.lili.modules.lmk.service.CustomerTagService;
|
import cn.lili.modules.member.entity.vo.MemberSearchVO;
|
import cn.lili.modules.member.entity.vo.MemberVO;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
|
@Validated
|
@RequiredArgsConstructor
|
@Api(value = "客户管理", tags = "管理")
|
@RestController
|
@RequestMapping("/manager/customerManager")
|
public class CustomerController {
|
private final CustomerService customerService;
|
private final CustomerTagService customerTagService;
|
private final CustomerTagRefService customerTagRefService;
|
|
@ApiOperation(value = "商铺下拉列表")
|
@GetMapping("/store/selectOption")
|
public Result getStoreSelectOptions(){
|
return customerService.getStoreSelectOptions();
|
}
|
|
@ApiOperation(value = "获得客户详情")
|
@GetMapping("/{id}")
|
public Result getCustomerInfo(@PathVariable String id){
|
return customerService.getMember(id);
|
}
|
|
@ApiOperation(value = "客户分页列表")
|
@GetMapping
|
public Result getByPage(CustomerQuery customerQuery) {
|
return customerService.getMemberPage(customerQuery);
|
}
|
|
@PostMapping("/addTag")
|
@ApiOperation(value = "添加标签", notes = "添加标签")
|
public Result add(@RequestBody @Validated(Add.class) CustomerTagForm form) {
|
return customerTagService.add(form);
|
}
|
|
@PutMapping("/editTag")
|
@ApiOperation(value = "修改标签", notes = "修改标签")
|
public Result update(@RequestBody @Validated(Update.class) CustomerTagForm form) {
|
return customerTagService.update(form);
|
}
|
|
@DeleteMapping("/tag/{id}")
|
@ApiOperation(value = "ID删除标签", notes = "ID删除")
|
public Result removeById(@PathVariable("id") String id) {
|
return customerTagService.removeById(id);
|
}
|
|
|
@GetMapping("/tagList")
|
@ApiOperation(value = "标签列表", notes = "标签列表")
|
public Result list() {
|
return customerTagService.all();
|
}
|
@GetMapping("/pageTagList")
|
@ApiOperation(value = "分页标签列表", notes = "标签列表")
|
public Result pageList(CustomerTagQuery query) {
|
return customerTagService.page(query);
|
}
|
|
|
@PostMapping("/customerAddTag")
|
@ApiOperation(value = "添加客户标签标识", notes = "添加客户标签标识")
|
public Result addCustomerTag(@RequestBody @Validated(Add.class) CustomerTagForm form) {
|
return customerTagService.addCustomerTag(form);
|
}
|
|
// @PostMapping("/customerAddTag")
|
// @ApiOperation(value = "添加客户标签标识", notes = "添加客户标签标识")
|
// public Result add(@RequestBody @Validated(Add.class) CustomerTagRefForm form) {
|
// return customerTagRefService.add(form);
|
// }
|
|
@PutMapping("/customerEditTag")
|
@ApiOperation(value = "修改客户标签标识", notes = "修改客户标签标识")
|
public Result update(@RequestBody @Validated(Update.class) CustomerTagRefForm form) {
|
return customerTagRefService.update(form);
|
}
|
|
@DeleteMapping("/customerDelTag/{id}")
|
@ApiOperation(value = "删除客户标签标识ID删除", notes = "删除客户标签标识ID删除")
|
public Result removeCustomerTagById(@PathVariable("id") String id) {
|
return customerTagRefService.removeById(id);
|
}
|
|
}
|