parent
ce376e4f31
commit
d678e74e4c
@ -0,0 +1,78 @@
|
||||
package com.sztzjy.block_finance.controller;
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-03-06 13:54
|
||||
*/
|
||||
|
||||
import com.sztzjy.block_finance.annotation.AnonymousAccess;
|
||||
import com.sztzjy.block_finance.entity.dto.StuAddNodesDto;
|
||||
import com.sztzjy.block_finance.entity.stuJoinNode;
|
||||
import com.sztzjy.block_finance.service.StuBusinessSupplyService;
|
||||
import com.sztzjy.block_finance.util.ResultEntity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.RequestEntity;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("api/stu/businessSupply")
|
||||
@Api(tags = "供应链接口")
|
||||
public class StuSupplyBusinessController {
|
||||
|
||||
@Autowired
|
||||
private StuBusinessSupplyService stuBusinessSupplyService;
|
||||
|
||||
|
||||
@GetMapping("/getNodesInfo")
|
||||
@ApiOperation(value = "获取首页节点信息")
|
||||
@AnonymousAccess
|
||||
public ResultEntity<List<stuJoinNode>> getNodesInfo(@ApiParam("用户ID") String userId){
|
||||
|
||||
List<stuJoinNode> nodeList = stuBusinessSupplyService.getNodesInfo(userId);
|
||||
|
||||
|
||||
return new ResultEntity<>(HttpStatus.OK,"获取成功",nodeList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/addNodes")
|
||||
@ApiOperation(value = "加入节点")
|
||||
@AnonymousAccess
|
||||
public ResultEntity addNodes(@Valid @RequestBody StuAddNodesDto stuAddNodesDto) throws NoSuchAlgorithmException {
|
||||
|
||||
stuBusinessSupplyService.addNodes(stuAddNodesDto);
|
||||
return new ResultEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/uploadBussinessImg")
|
||||
@ApiOperation(value = "上传营业执照")
|
||||
@AnonymousAccess
|
||||
public ResultEntity<String> uploadBussinessImg(@RequestPart MultipartFile file,
|
||||
@ApiParam("用户ID") String userId,
|
||||
@ApiParam("用户名")String userName){
|
||||
|
||||
String path = stuBusinessSupplyService.uploadBussinessImg(file,userId,userName);
|
||||
return new ResultEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.sztzjy.block_finance.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-03-06 14:07
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiModel(description = "加入节点,注册账号")
|
||||
public class StuAddNodesDto {
|
||||
|
||||
@ApiModelProperty(required = true,value = "注册用户((传参:昆明闻泰通讯有限公司 ,信丰世嘉科技有限公司 ,银邦科技有限公司 ,深圳拓朴商业保理有限公司))")
|
||||
@NotBlank(message = "注册用户不能为空")
|
||||
private String regName;
|
||||
|
||||
@ApiModelProperty(required = true,value = "纳税识别号")
|
||||
@NotBlank(message = "纳税识别号不能为空")
|
||||
private String taxAccount;
|
||||
|
||||
@ApiModelProperty(required = true,value = "营业执照地址")
|
||||
@NotBlank(message = "营业执照上传地址不能为空")
|
||||
private String imgAddress;
|
||||
|
||||
@ApiModelProperty(required = true,value = "用户ID")
|
||||
@NotBlank(message = "用户ID不能为空")
|
||||
private String userId;
|
||||
|
||||
|
||||
public StuAddNodesDto() {
|
||||
}
|
||||
|
||||
public StuAddNodesDto(String regName, String taxAccount, String imgAddress, String userId) {
|
||||
this.regName = regName;
|
||||
this.taxAccount = taxAccount;
|
||||
this.imgAddress = imgAddress;
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getRegName() {
|
||||
return regName;
|
||||
}
|
||||
|
||||
public void setRegName(String regName) {
|
||||
this.regName = regName;
|
||||
}
|
||||
|
||||
public String getTaxAccount() {
|
||||
return taxAccount;
|
||||
}
|
||||
|
||||
public void setTaxAccount(String taxAccount) {
|
||||
this.taxAccount = taxAccount;
|
||||
}
|
||||
|
||||
public String getImgAddress() {
|
||||
return imgAddress;
|
||||
}
|
||||
|
||||
public void setImgAddress(String imgAddress) {
|
||||
this.imgAddress = imgAddress;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.sztzjy.block_finance.service;
|
||||
|
||||
import com.sztzjy.block_finance.entity.dto.StuAddNodesDto;
|
||||
import com.sztzjy.block_finance.entity.stuJoinNode;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 17803
|
||||
* @date 2024-03-06 14:23
|
||||
*/
|
||||
public interface StuBusinessSupplyService {
|
||||
//获取首页节点信息
|
||||
List<stuJoinNode> getNodesInfo(String userId);
|
||||
|
||||
//加入节点
|
||||
void addNodes(StuAddNodesDto stuAddNodesDto) throws NoSuchAlgorithmException;
|
||||
|
||||
//上传营业执照
|
||||
String uploadBussinessImg(MultipartFile file,
|
||||
String userId,
|
||||
String userName);
|
||||
}
|
Loading…
Reference in New Issue