|  |  | 
 |  |  | package com.doumee.api.web; | 
 |  |  |  | 
 |  |  | import com.doumee.biz.zbom.ZbomZhongTaiService; | 
 |  |  | import com.doumee.config.annotation.UserLoginRequired; | 
 |  |  | import com.doumee.core.annotation.trace.Trace; | 
 |  |  | import com.doumee.core.model.ApiResponse; | 
 |  |  | import com.doumee.dao.business.model.SmsEmail; | 
 |  |  | import com.doumee.dao.web.response.AccountResponse; | 
 |  |  | import com.doumee.dao.web.response.ZSZXCatalogResponse; | 
 |  |  | import com.doumee.service.business.SmsEmailService; | 
 |  |  | import com.doumee.service.business.UsersService; | 
 |  |  | import io.swagger.annotations.Api; | 
 |  |  | 
 |  |  | import io.swagger.annotations.ApiOperation; | 
 |  |  | import lombok.extern.slf4j.Slf4j; | 
 |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
 |  |  | import org.springframework.web.bind.annotation.GetMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
 |  |  | import org.springframework.web.bind.annotation.RequestParam; | 
 |  |  | import org.springframework.web.bind.annotation.RestController; | 
 |  |  | import org.springframework.web.bind.annotation.*; | 
 |  |  |  | 
 |  |  | /** | 
 |  |  |  * Created by IntelliJ IDEA. | 
 |  |  | 
 |  |  | @Api(tags = "分类和标签相关接口") | 
 |  |  | @Trace(exclude = true) | 
 |  |  | @RestController | 
 |  |  | @RequestMapping("/web/personnel") | 
 |  |  | @RequestMapping("/web/catalog") | 
 |  |  | @Slf4j | 
 |  |  | public class CatalogApi extends ApiController{ | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     public UsersService usersService; | 
 |  |  |     public ZbomZhongTaiService zbomZhongTaiService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     public SmsEmailService smsEmailService; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "小程序登陆", notes = "员工端小程序") | 
 |  |  |     @GetMapping("/loginByWx") | 
 |  |  |     @ApiImplicitParams({ | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "微信code", required = true), | 
 |  |  |     }) | 
 |  |  |     public ApiResponse<AccountResponse> loginByWx(@RequestParam String code) { | 
 |  |  |         return  ApiResponse.success(usersService.wxLogin(code)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "发送短信验证码", notes = "员工端小程序") | 
 |  |  |     @GetMapping("/sendSms") | 
 |  |  |     @ApiImplicitParams({ | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "phone", value = "手机号", required = true), | 
 |  |  |     }) | 
 |  |  |     public ApiResponse sendSms(@RequestParam String phone) { | 
 |  |  |         SmsEmail smsEmail = new SmsEmail(); | 
 |  |  |         smsEmail.setPhone(phone); | 
 |  |  |         smsEmailService.sendSms(smsEmail); | 
 |  |  |         return  ApiResponse.success("发送成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @ApiOperation(value = "手机号验证码登陆", notes = "员工端小程序") | 
 |  |  |     @GetMapping("/loginByPhone") | 
 |  |  |     @ApiImplicitParams({ | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "phone", value = "手机号", required = true), | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "短信验证码", required = true), | 
 |  |  |     }) | 
 |  |  |     public ApiResponse<AccountResponse> loginByPhone(@RequestParam String phone,@RequestParam String code) { | 
 |  |  |         return  ApiResponse.success(usersService.phoneLogin(phone,code)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @UserLoginRequired | 
 |  |  |     @ApiOperation(value = "绑定openid", notes = "员工端小程序") | 
 |  |  |     @GetMapping("/bindingOpenid") | 
 |  |  |     @ApiImplicitParams({ | 
 |  |  |             @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "微信code", required = true), | 
 |  |  |     }) | 
 |  |  |     public ApiResponse bindingOpenid(@RequestParam String code) { | 
 |  |  |         usersService.bindingOpenid(code,getMemberId()); | 
 |  |  |         return  ApiResponse.success("操作成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |