package com.doumee.api.web; import com.doumee.biz.zbom.ZbomCRMService; import com.doumee.config.annotation.LoginRequired; import com.doumee.core.annotation.trace.Trace; import com.doumee.core.model.ApiResponse; import com.doumee.core.model.PageData; import com.doumee.core.model.PageWrap; import com.doumee.dao.business.model.CustomerLog; import com.doumee.dao.business.model.Member; import com.doumee.dao.business.model.Shop; import com.doumee.dao.business.model.Users; import com.doumee.dao.web.reqeust.*; import com.doumee.dao.web.response.AccountResponse; import com.doumee.dao.web.response.BjParamConfigResponse; import com.doumee.service.business.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** * Created by IntelliJ IDEA. * * @Author : Rk * @create 2024/7/10 14:03 */ @Api(tags = "【C端小程序】用户业务") @Trace(exclude = true) @RestController @RequestMapping("/web/customer") @Slf4j public class CustomerApi extends ApiController{ @Autowired private MemberService memberService; @Autowired private BjParamService bjParamService; @Autowired private CustomerService customerService; @Autowired private ZbomCRMService zbomCRMService; @Autowired private ShopService shopService; @Autowired private UsersService usersService; @ApiOperation(value = "客户端小程序登陆", notes = "客户端小程序") @GetMapping("/wxLoginCustomer") @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "微信code", required = true), }) public ApiResponse wxLoginCustomer(@RequestParam String code) { return ApiResponse.success(memberService.wxLogin(code)); } @LoginRequired @ApiOperation(value = "获取手机号", notes = "客户端小程序") @PostMapping("/getWxMiniPhone") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) }) public ApiResponse getWxMiniPhone(@Valid @RequestBody WxPhoneRequest wxPhoneRequest) { return ApiResponse.success("获取成功",memberService.getWxMiniPhone(wxPhoneRequest)); } @LoginRequired @ApiOperation(value = "更新个人信息", notes = "客户端小程序") @PostMapping("/editMember") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) }) public ApiResponse updMemberDetail(@RequestBody EditMemberRequest editMemberRequest) { editMemberRequest.setMemberId(getMemberId()); memberService.updMemberDetail(editMemberRequest); return ApiResponse.success("更新成功"); } @LoginRequired @ApiOperation(value = "获取个人信息", notes = "客户端小程序") @GetMapping("/getMemberInfo") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) }) public ApiResponse getMemberInfo() { return ApiResponse.success("获取成功",memberService.getMemberInfo(getMemberId())); } @ApiOperation(value = "获取报价配置", notes = "客户端小程序") @GetMapping("/getBjParamConfig") public ApiResponse getBjParamConfig() { return ApiResponse.success(bjParamService.getBjParamConfig()); } @LoginRequired @ApiOperation(value = "装修计算器信息存储", notes = "客户端小程序") @PostMapping("/saveRenovationCalculator") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) }) public ApiResponse saveRenovationCalculator(@RequestBody RenovationCalculatorDTO renovationCalculatorDTO) { renovationCalculatorDTO.setMemberId(getMemberId()); CustomerLog customerLog =customerService.saveRenovationCalculator(renovationCalculatorDTO); zbomCRMService.dealCustomerLogData(customerLog); return ApiResponse.success("操作成功"); } @LoginRequired @ApiOperation(value = "0元定制信息", notes = "客户端小程序") @PostMapping("/saveFreeCustomizationApply") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) }) public ApiResponse saveFreeCustomizationApply(@RequestBody FreeCustomizationDTO freeCustomizationDTO) { freeCustomizationDTO.setMemberId(getMemberId()); CustomerLog customerLog = customerService.saveFreeCustomizationApply(freeCustomizationDTO); zbomCRMService.dealCustomerLogData(customerLog); return ApiResponse.success("操作成功"); } @LoginRequired @ApiOperation(value = "测试装修风格", notes = "客户端小程序") @PostMapping("/saveTestTrimStyle") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true) }) public ApiResponse saveTestTrimStyle(@RequestBody TestTrimStyleDTO testTrimStyleDTO) { testTrimStyleDTO.setMemberId(getMemberId()); CustomerLog customerLog = customerService.saveTestTrimStyle(testTrimStyleDTO); zbomCRMService.dealCustomerLogData(customerLog); return ApiResponse.success("操作成功"); } @LoginRequired @ApiOperation(value = "用户注销", notes = "客户端小程序") @GetMapping("/logOff") public ApiResponse logOff() { memberService.logOff(getMemberId()); return ApiResponse.success("操作成功"); } @LoginRequired @ApiOperation(value = "门店列表", notes = "客户端小程序") @PostMapping("/shopPage") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), }) public ApiResponse> shopPage (@RequestBody PageWrap pageWrap) { return ApiResponse.success(shopService.queryShopByLL(pageWrap)); } @LoginRequired @ApiOperation(value = "门店详情", notes = "客户端小程序") @GetMapping("/shopDetail") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), @ApiImplicitParam(paramType = "query", dataType = "Long", name = "shopId", value = "门店主键", required = true) }) public ApiResponse shopDetail (@RequestParam Long shopId) { Long memberId = this.getMemberId(); return ApiResponse.success(shopService.shopDetail(shopId,memberId)); } @LoginRequired @ApiOperation(value = "导购详情", notes = "客户端小程序") @GetMapping("/usersDetail") @ApiImplicitParams({ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), @ApiImplicitParam(paramType = "query", dataType = "Long", name = "userId", value = "导购主键", required = true) }) public ApiResponse usersDetail (@RequestParam Long userId) { return ApiResponse.success(usersService.usersDetail(userId)); } }