src/main/java/com/mzl/flower/config/ResourceServerConfig.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/mzl/flower/dto/response/customer/CustomerDTO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/mzl/flower/service/customer/CustomerService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/mzl/flower/web/customer/CustomerController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/mzl/flower/config/ResourceServerConfig.java
@@ -54,6 +54,7 @@ .antMatchers("/api/customer/flower/list").permitAll() .antMatchers("/api/customer/flower/list/view").permitAll() .antMatchers("/api/customer/flower/up/stock").permitAll() // .antMatchers("/api/customer/info/**").permitAll() .antMatchers("api/pub/customer/home/**").permitAll() .antMatchers("/api/customer/point/goods/**").permitAll() .antMatchers("/api/upload/oss/file").permitAll() src/main/java/com/mzl/flower/dto/response/customer/CustomerDTO.java
@@ -60,4 +60,15 @@ private UserGrowthRecordDTO userGrowthRecord; private Integer orderNum; @ApiModelProperty("会员到期时间") private LocalDateTime memberOvertime; @ApiModelProperty("会员到期日期") private String memberOverDate; @ApiModelProperty("会员/非会员") private Boolean isMember; private String contactTel; } src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mzl.flower.dto.request.customer.QueryCustomerDTO; import com.mzl.flower.dto.response.customer.CustomerDTO; import com.mzl.flower.dto.response.supplier.SupplierDTO; import com.mzl.flower.entity.customer.Customer; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -37,4 +38,7 @@ Boolean updateMemberLevelByPoint(@Param("levelId") Long levelId, @Param("startPoint") int startPoint, @Param("endPoint") int endPoint); @Select("select * from t_customer_info where user_id = ( select id from t_user where tel =#{phone} and type = 'customer')") CustomerDTO findCustomerByPhone(String phone); } src/main/java/com/mzl/flower/service/customer/CustomerService.java
@@ -13,6 +13,7 @@ import com.mzl.flower.dto.request.menber.UserGrowthRecordDTO; import com.mzl.flower.dto.response.customer.CustomerDTO; import com.mzl.flower.dto.response.partner.PartnerDTO; import com.mzl.flower.dto.response.supplier.SupplierDTO; import com.mzl.flower.entity.customer.Customer; import com.mzl.flower.entity.partner.Partner; import com.mzl.flower.enums.TrueOrFalseEnum; @@ -28,6 +29,8 @@ import org.springframework.util.ObjectUtils; import javax.annotation.Resource; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; @Service @@ -252,4 +255,13 @@ return null; } public CustomerDTO findCustomerByPhone(String phone) { CustomerDTO customerByPhone = customerMapper.findCustomerByPhone(phone); if (customerByPhone != null && customerByPhone.getMemberOvertime() != null) { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); customerByPhone.setMemberOverDate(customerByPhone.getMemberOvertime().format(formatter)); } customerByPhone.setContactTel(phone); return customerByPhone; } } src/main/java/com/mzl/flower/web/customer/CustomerController.java
@@ -89,4 +89,10 @@ customerService.isEnable(id); return returnData(R.SUCCESS.getCode(),null); } @GetMapping("/info/{phone}") @ApiOperation(value = "用户详情", notes = "用户详情") public ResponseEntity<ReturnDataDTO<CustomerDTO>> findCustomerByPhone(@PathVariable("phone") String phone) { return returnData(R.SUCCESS.getCode(),customerService.findCustomerByPhone(phone)); } } src/main/resources/application.yml
@@ -1,7 +1,7 @@ server: port: 8080 servlet: context-path: /smart_message context-path: /flower spring: application: