Merge remote-tracking branch 'origin/dev'

dev2
WeiRan 2024-08-29 16:35:31 +08:00
commit 6b81784684
17 changed files with 8596 additions and 23 deletions

View File

@ -58,10 +58,6 @@ public class Product extends BaseEntity {
*/ */
*/ */
private String productSpecification; private String productSpecification;
/**
*
*/
private Integer productInventory;
/** /**
* *
*/ */
@ -79,7 +75,15 @@ public class Product extends BaseEntity {
/** /**
* *
*/ */
private String productAddress; private String apiAddress;
/**
*
*/
private String returnFormat;
/**
*
*/
private String requestMethod;
public static Product addProductList(ProductAddReq productAddReq){ public static Product addProductList(ProductAddReq productAddReq){
return Product.builder() return Product.builder()
@ -89,11 +93,12 @@ public class Product extends BaseEntity {
.productContent(productAddReq.getProductContent()) .productContent(productAddReq.getProductContent())
.productState(productAddReq.getProductState()) .productState(productAddReq.getProductState())
.productSpecification(productAddReq.getProductSpecification()) .productSpecification(productAddReq.getProductSpecification())
.productInventory(productAddReq.getProductInventory())
.productSales(productAddReq.getProductSales()) .productSales(productAddReq.getProductSales())
.productType(productAddReq.getProductType()) .productType(productAddReq.getProductType())
.productShelvesdate(productAddReq.getProductShelvesdate()) .productShelvesdate(productAddReq.getProductShelvesdate())
.productAddress(productAddReq.getProductAddress()) .apiAddress(productAddReq.getApiAddress())
.returnFormat(productAddReq.getReturnFormat())
.requestMethod(productAddReq.getRequestMethod())
.build(); .build();
} }
@ -106,11 +111,12 @@ public class Product extends BaseEntity {
.productContent(productUpdReq.getProductContent()) .productContent(productUpdReq.getProductContent())
.productState(productUpdReq.getProductState()) .productState(productUpdReq.getProductState())
.productSpecification(productUpdReq.getProductSpecification()) .productSpecification(productUpdReq.getProductSpecification())
.productInventory(productUpdReq.getProductInventory())
.productSales(productUpdReq.getProductSales()) .productSales(productUpdReq.getProductSales())
.productType(productUpdReq.getProductType()) .productType(productUpdReq.getProductType())
.productShelvesdate(productUpdReq.getProductShelvesdate()) .productShelvesdate(productUpdReq.getProductShelvesdate())
.productAddress(productUpdReq.getProductAddress()) .apiAddress(productUpdReq.getApiAddress())
.returnFormat(productUpdReq.getReturnFormat())
.requestMethod(productUpdReq.getRequestMethod())
.build(); .build();
} }

View File

@ -1,5 +1,7 @@
package com.muyu.cloud.market.domin; package com.muyu.cloud.market.domin;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -27,7 +29,8 @@ public class User {
/** /**
* ID * ID
*/ */
private Integer userId; @TableId(value = "user_id",type = IdType.AUTO)
private long userId;
/** /**
* ID * ID
@ -129,6 +132,14 @@ public class User {
* *
*/ */
private BigDecimal userMoney; private BigDecimal userMoney;
/**
*
*/
private Integer isPersonlink;
/**
*
*/
private Integer isCompanyid;
} }

View File

@ -1,11 +1,14 @@
package com.muyu.cloud.market.domin.req; package com.muyu.cloud.market.domin.req;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/** /**
* @Authorweiran * @Authorweiran
* @Packagecom.muyu.cloud.background.domin.req * @Packagecom.muyu.cloud.background.domin.req
@ -57,5 +60,15 @@ public class CompanyListReq {
* *
*/ */
private String companyAddress; private String companyAddress;
/**
*
*/
@Schema(description = "审核状态",defaultValue = "0",type = "Integer")
private Integer reviewStatus;
/**
*
*/
@Schema(description = "公司注册账户余额",defaultValue = "0",type = "BigDecimal")
private BigDecimal companyMoney;
} }

View File

@ -50,10 +50,6 @@ public class ProductAddReq {
*/ */
*/ */
private String productSpecification; private String productSpecification;
/**
*
*/
private Integer productInventory;
/** /**
* *
*/ */
@ -71,5 +67,13 @@ public class ProductAddReq {
/** /**
* *
*/ */
private String productAddress; private String apiAddress;
/**
*
*/
private String returnFormat;
/**
*
*/
private String requestMethod;
} }

View File

@ -48,7 +48,15 @@ public class ProductListReq {
/** /**
* *
*/ */
private String productAddress; private String apiAddress;
/**
*
*/
private String returnFormat;
/**
*
*/
private String requestMethod;
/** /**
* 1 * 1
*/ */

View File

@ -49,10 +49,6 @@ public class ProductUpdReq {
*/ */
*/ */
private String productSpecification; private String productSpecification;
/**
*
*/
private Integer productInventory;
/** /**
* *
*/ */
@ -70,5 +66,13 @@ public class ProductUpdReq {
/** /**
* *
*/ */
private String productAddress; private String apiAddress;
/**
*
*/
private String returnFormat;
/**
*
*/
private String requestMethod;
} }

View File

@ -52,7 +52,15 @@ public class ProductListResp {
/** /**
* *
*/ */
private String productAddress; private String apiAddress;
/**
*
*/
private String returnFormat;
/**
*
*/
private String requestMethod;
@Schema(description = "创建人",defaultValue = "muyu",type = "String") @Schema(description = "创建人",defaultValue = "muyu",type = "String")
private String createBy; private String createBy;
@ -78,7 +86,9 @@ public class ProductListResp {
.productContent(product.getProductContent()) .productContent(product.getProductContent())
.productState(product.getProductState()) .productState(product.getProductState())
.productSales(product.getProductSales()) .productSales(product.getProductSales())
.productAddress(product.getProductAddress()) .apiAddress(product.getApiAddress())
.returnFormat(product.getReturnFormat())
.requestMethod(product.getRequestMethod())
.createBy(product.getCreateBy()) .createBy(product.getCreateBy())
.createTime(product.getCreateTime()) .createTime(product.getCreateTime())
.build(); .build();

View File

@ -25,6 +25,12 @@
<version>1.0.0</version> <version>1.0.0</version>
</dependency> </dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
<!-- 图片上传 --> <!-- 图片上传 -->
<dependency> <dependency>
<groupId>com.aliyun.oss</groupId> <groupId>com.aliyun.oss</groupId>

View File

@ -1,10 +1,16 @@
package com.muyu.cloud.market.controller; package com.muyu.cloud.market.controller;
import com.muyu.cloud.market.domin.req.CompanyListReq;
import com.muyu.cloud.market.service.CompanyService;
import com.muyu.cloud.market.util.OssUtil; import com.muyu.cloud.market.util.OssUtil;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -22,6 +28,8 @@ import org.springframework.web.multipart.MultipartFile;
@RequestMapping("/company") @RequestMapping("/company")
@Tag(name = "企业管理控制层",description = "进行企业管理、查看等相关操作") @Tag(name = "企业管理控制层",description = "进行企业管理、查看等相关操作")
public class CompanyController { public class CompanyController {
@Autowired
private CompanyService companyService;
/** /**
@ -38,6 +46,23 @@ public class CompanyController {
} }
/**
*
* @param companyListReq
* @return
*/
@PostMapping(path = "/companyauthentication")
@Operation(summary = "企业绑定",description = "企业绑定")
public Result companyauthentication(@Validated @RequestBody CompanyListReq companyListReq, HttpServletRequest request){
companyService.companyauthentication(companyListReq,request);
return Result.success(null,"绑定成功");
}
} }

View File

@ -2,6 +2,7 @@ package com.muyu.cloud.market.controller;
import com.muyu.cloud.market.domin.req.LinkEmailReq; import com.muyu.cloud.market.domin.req.LinkEmailReq;
import com.muyu.cloud.market.service.UserService; import com.muyu.cloud.market.service.UserService;
import com.muyu.cloud.market.util.OssUtil;
import com.muyu.common.core.domain.Result; import com.muyu.common.core.domain.Result;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -9,6 +10,7 @@ import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/** /**
* @Authorweiran * @Authorweiran
@ -50,4 +52,17 @@ public class UserController {
userService.linkemail(linkEmailReq,request); userService.linkemail(linkEmailReq,request);
return Result.success(null, "操作成功"); return Result.success(null, "操作成功");
} }
/**
*
*
* @param file
* @return
*/
@PostMapping(path = "/upload")
@Operation(summary = "图片上传",description = "图片上传")
public Result upload(MultipartFile file){
String s= OssUtil.uploadMultipartFile(file);
return Result.success(s);
}
} }

View File

@ -2,6 +2,8 @@ package com.muyu.cloud.market.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.cloud.market.domin.Company; import com.muyu.cloud.market.domin.Company;
import com.muyu.cloud.market.domin.req.CompanyListReq;
import jakarta.servlet.http.HttpServletRequest;
/** /**
* @Authorweiran * @Authorweiran
@ -11,4 +13,11 @@ import com.muyu.cloud.market.domin.Company;
* @Date2024/8/27 14:17 * @Date2024/8/27 14:17
*/ */
public interface CompanyService extends IService<Company> { public interface CompanyService extends IService<Company> {
/**
*
* @param companyListReq
* @return
*/
void companyauthentication(CompanyListReq companyListReq, HttpServletRequest request);
} }

View File

@ -36,4 +36,6 @@ public interface ProductApiService extends IService<Product> {
* @return * @return
*/ */
List<String> selectproductTypeList(); List<String> selectproductTypeList();
} }

View File

@ -1,9 +1,16 @@
package com.muyu.cloud.market.service.impl; package com.muyu.cloud.market.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.cloud.market.domin.Company; import com.muyu.cloud.market.domin.Company;
import com.muyu.cloud.market.domin.req.CompanyListReq;
import com.muyu.cloud.market.mapper.CompanyMapper; import com.muyu.cloud.market.mapper.CompanyMapper;
import com.muyu.cloud.market.service.CompanyService; import com.muyu.cloud.market.service.CompanyService;
import com.muyu.common.security.service.TokenService;
import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.LoginUser;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
@ -15,4 +22,27 @@ import org.springframework.stereotype.Service;
*/ */
@Service @Service
public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements CompanyService { public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements CompanyService {
@Autowired
private CompanyMapper companyMapper;
@Autowired
private TokenService tokenService;
/**
*
* @param companyListReq
* @return
*/
@Override
public void companyauthentication(CompanyListReq companyListReq, HttpServletRequest request) {
// //获取当前登录人信息
// String token = SecurityUtils.getToken();// 获取当前Token
// LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
// if (loginUser == null) {
// throw new RuntimeException("用户未登录或Token无效");
// }
// Long userid = loginUser.getUserid();
LambdaQueryWrapper<Company> queryWrapper = new LambdaQueryWrapper<>();
}
} }

View File

@ -80,6 +80,7 @@ public class ProductApiServiceImpl extends ServiceImpl<ProductApiMapper, Product
/** /**
* *
*
* @return * @return
*/ */
@Override @Override
@ -88,4 +89,5 @@ public class ProductApiServiceImpl extends ServiceImpl<ProductApiMapper, Product
} }
} }

View File

@ -87,10 +87,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements co
*/ */
@Override @Override
public String sendcode(String email) { public String sendcode(String email) {
if (email.isEmpty()){
throw new RuntimeException("邮箱不能为空");
}
//生成验证码 //生成验证码
String code = RandomUtil.randomNumbers(4); String code = RandomUtil.randomNumbers(4);
//验证码存入redis中 //验证码存入redis中
redisTemplate.opsForValue().set(email, code,5, TimeUnit.MINUTES); redisTemplate.opsForValue().set(email, code,5, TimeUnit.MINUTES);
MimeMessage mimeMessage = javaMailSender.createMimeMessage(); MimeMessage mimeMessage = javaMailSender.createMimeMessage();
try { try {
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true); MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff