Commit f868a2b5 authored by 33's avatar 33

优化代码,修复隐藏BUG

parent 03010f71
......@@ -11,11 +11,12 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
......@@ -27,13 +28,10 @@ import java.util.List;
@RestController
@RequestMapping("/banner")
@Api(tags = "banner页管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class BannerController {
@Resource
private BannerService bannerService;
@Resource
private ObsUtil obsUtil;
private final BannerService bannerService;
private final ObsUtil obsUtil;
@PostMapping("/create")
@ApiOperation("新建banner")
......
......@@ -6,11 +6,12 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -21,10 +22,9 @@ import java.util.List;
@RestController
@RequestMapping(value = "/category")
@Api(tags = "类目管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CategoryController {
@Resource
private CategoryService categoryService;
private final CategoryService categoryService;
@GetMapping("/list")
@ApiOperation(value = "查询所有类目信息")
......
......@@ -7,10 +7,10 @@ import com.fzm.common.service.ChargeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/1/25 10:13
......@@ -19,10 +19,10 @@ import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/charge")
@Api(tags = "收费管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ChargeController {
@Resource
private ChargeService chargeService;
private final ChargeService chargeService;
@PostMapping("/update")
@ApiOperation("编辑")
......
......@@ -9,9 +9,10 @@ import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
......@@ -23,11 +24,9 @@ import java.util.concurrent.ExecutionException;
@RestController
@RequestMapping(value = "/copyright/apply")
@Api(tags = "版权审核")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightApplyController {
@Resource
private CopyrightApplyService copyrightApplyService;
private final CopyrightApplyService copyrightApplyService;
@GetMapping(value = "/pages")
@ApiOperation(value = "分页查询")
......
......@@ -8,13 +8,13 @@ import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
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 javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/1/11 17:19
......@@ -23,12 +23,9 @@ import javax.annotation.Resource;
@RestController
@RequestMapping("/entrust/shelf")
@Api(tags = "委托上架")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class EntrustShelfController {
@Resource
private EntrustShelfService entrustShelfService;
private final EntrustShelfService entrustShelfService;
@GetMapping("/page")
@ApiOperation(value = "分页查询")
......
......@@ -12,10 +12,11 @@ import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -27,13 +28,10 @@ import java.util.List;
@RestController
@RequestMapping("/nft")
@Api(tags = "剧本nft管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftController {
@Resource
private NftService nftService;
@Resource
private NftTransferRecordService nftTransferRecordService;
private final NftService nftService;
private final NftTransferRecordService nftTransferRecordService;
@GetMapping("/list")
@ApiOperation(value = "查询nft列表")
......
......@@ -8,13 +8,13 @@ import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
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 javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/2/8 16:11
......@@ -23,10 +23,9 @@ import javax.annotation.Resource;
@RestController
@RequestMapping("/payment")
@Api(tags = "支付流水管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PaymentController {
@Resource
private PaymentService paymentService;
private final PaymentService paymentService;
@GetMapping("/pages")
@ApiOperation(value = "分页查询")
......
......@@ -8,12 +8,13 @@ import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
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 javax.annotation.Resource;
import java.io.IOException;
/**
......@@ -24,10 +25,9 @@ import java.io.IOException;
@RestController
@RequestMapping("/refund")
@Api(tags = "退款管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RefundController {
@Resource
private RefundService refundService;
private final RefundService refundService;
@GetMapping("/pages")
@ApiOperation(value = "退款分页列表")
......
......@@ -11,12 +11,13 @@ import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
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 javax.annotation.Resource;
import java.util.List;
/**
......@@ -27,10 +28,9 @@ import java.util.List;
@RestController
@RequestMapping("/admin")
@Api(tags = "用户管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class UserController {
@Resource
private UserService userService;
private final UserService userService;
@GetMapping("statistic")
@ApiOperation(value = "用户概览", notes = "获取已注册用户、已实名用户等统计信息")
......
......@@ -6,13 +6,14 @@ import com.fzm.common.entity.CopyrightApply;
import com.fzm.common.entity.dto.EvidenceHashMessage;
import com.fzm.common.service.CopyrightApplyService;
import com.rabbitmq.client.Channel;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.IOException;
/**
......@@ -21,13 +22,10 @@ import java.io.IOException;
*/
@Slf4j
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class EvidenceHashLister {
@Resource
private CopyrightApplyService copyrightApplyService;
@Resource
private ParaChainClient paraChainClient;
private final CopyrightApplyService copyrightApplyService;
private final ParaChainClient paraChainClient;
/**
* 更新存证hash
......
......@@ -25,16 +25,17 @@ import com.fzm.common.service.OrderService;
import com.fzm.common.service.WxPayService;
import com.fzm.common.utils.CopyrightSignUtil;
import com.fzm.common.utils.JsonUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -47,41 +48,21 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightTask {
@Resource
private CopyrightApplyService copyrightApplyService;
@Resource
private Redisson redisson;
@Resource
private CopyrightProperties copyrightProperties;
@Resource
private ParaChainClient paraChainClient;
@Resource
private NftService nftService;
private static String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
private final CopyrightApplyService copyrightApplyService;
private final Redisson redisson;
private final CopyrightProperties copyrightProperties;
private final ParaChainClient paraChainClient;
private final NftService nftService;
private final RabbitTemplate rabbitTemplate;
private final WxPayService wxPayService;
private final OrderService orderService;
private final NotifyPublisher notifyPublisher;
@Value("${chain.para.cAddr}")
private String contractAddr;
@Resource
private RabbitTemplate rabbitTemplate;
@Resource
private WxPayService wxPayService;
@Resource
private OrderService orderService;
@Resource
private NotifyPublisher notifyPublisher;
/**
* 定时任务更新版权申请状态
*/
......@@ -146,6 +127,7 @@ public class CopyrightTask {
copyrightApply.setRegisterTime(copyrightResponse.getCertificate().getFinish_time());
copyrightApply.setRegisterState(CopyrightApplyState.SUCCEEDED.getCode());
Nft nft = nftService.getByNftHash(nftHash);
String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
String tokenInfo = paraChainClient.evmGetTokenInfo(abi, contractAddr, nft.getTokenId(), nft.getPublishAddress());
NftVo detail = nftService.getDetail(nftHash);
String newTokenInfo = appendTokenInfo(tokenInfo, detail.getCopyright());
......
......@@ -17,10 +17,6 @@ public class RabbitMQConfig {
public static final String DEAD_LETTER_DIRECT = "dl.direct";
public static final String COPYRIGHT_QUEUE = "copyright.queue";
public static final String DEAD_LETTER_QUEUE = "dl.queue";
public static final String EVIDENCE_HASH_QUEUE = "evidence.hash.queue";
......
package com.fzm.common.config;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.CacheProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
......@@ -12,10 +13,9 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
@Configuration
@EnableConfigurationProperties(value = CacheProperties.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RedisCacheConfig {
@Autowired
private CacheProperties cacheProperties;
private final CacheProperties cacheProperties;
@Bean
public RedisCacheConfiguration redisCacheConfiguration() {
......
package com.fzm.common.config;
import lombok.RequiredArgsConstructor;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2021/7/19 10:25
......@@ -17,10 +17,9 @@ import javax.annotation.Resource;
* </p>
*/
@Configuration
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RedissonConfig {
@Resource
RedisProperties redisProperties;
private final RedisProperties redisProperties;
@Bean
public RedissonClient redisson() {
......@@ -28,7 +27,6 @@ public class RedissonConfig {
config.useSingleServer().
setAddress(String.format("redis://%s:%s", redisProperties.getHost(), redisProperties.getPort())).
setPassword(redisProperties.getPassword());
RedissonClient redisson = Redisson.create(config);
return redisson;
return Redisson.create(config);
}
}
......@@ -12,12 +12,13 @@ import com.wechat.pay.contrib.apache.httpclient.cert.CertificatesManager;
import com.wechat.pay.contrib.apache.httpclient.exception.HttpCodeException;
import com.wechat.pay.contrib.apache.httpclient.exception.NotFoundException;
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
import lombok.RequiredArgsConstructor;
import org.apache.http.impl.client.CloseableHttpClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import javax.annotation.Resource;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
......@@ -28,11 +29,9 @@ import java.security.PrivateKey;
* @date 2022/1/12 16:30
*/
@Configuration
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WxPayConfig {
@Resource
private WxPayProperties wxPayProperties;
private final WxPayProperties wxPayProperties;
@Bean
public PrivateKey wxPrivateKey() {
......
......@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fzm.common.constant.TokenConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
......@@ -13,6 +14,7 @@ import java.util.Date;
* @author tangtuo
* @date 2021/7/5 15:02
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@TableName("tb_admin")
......
......@@ -3,12 +3,14 @@ package com.fzm.common.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @author tangtuo
* @date 2021/7/1 14:32
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("tb_category")
@Accessors(chain = true)
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
......@@ -15,6 +16,7 @@ import java.util.Date;
* @author tangtuo
* @date 2021/6/30 15:42
*/
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("nft信息")
@Accessors(chain = true)
......
......@@ -6,6 +6,7 @@ import com.fzm.common.constant.TokenConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
......@@ -15,6 +16,7 @@ import java.util.Date;
* @author tangtuo
* @date 2021/6/23 11:54
*/
@EqualsAndHashCode(callSuper = true)
@Data
@Accessors(chain = true)
@ApiModel("用户信息")
......
/**
* Copyright 2021 bejson.com
*/
package com.fzm.common.entity.dto;
import cn.hutool.core.date.DateUtil;
......@@ -102,7 +99,6 @@ public class CopyrightRequest {
@ApiModelProperty(value = "著作权人列表")
private List<Owner> owner_list = new ArrayList<>();
;
@ApiModelProperty(value = "发表地点")
private String publish_address;
......
......@@ -15,7 +15,7 @@ public enum AuthStatus {
SUCCESS(1, "认证成功"),
FAIL(2, "认证失败"),
;
private Integer status;
private final Integer status;
private String desc;
private final String desc;
}
......@@ -11,9 +11,9 @@ public enum AuthType {
PERSON(0, "个人认证"),
ENTERPRISE(1, "企业认证");
private Integer type;
private final Integer type;
private String desc;
private final String desc;
AuthType(Integer type, String desc) {
this.type = type;
......
......@@ -18,8 +18,8 @@ public enum AuthorityAcquire {
OTHER(4, "其他"),
;
private int code;
private String val;
private final int code;
private final String val;
public static int getByType(String type) {
for (AuthorityAcquire value : AuthorityAcquire.values()) {
......
......@@ -19,8 +19,8 @@ public enum AuthorityType {
ENTRUST(5, "委托作品"),
;
private int code;
private String val;
private final int code;
private final String val;
public static int getByType(String type) {
for (AuthorityType value : AuthorityType.values()) {
......
......@@ -28,11 +28,11 @@ public enum CertificatesType {
;
@ApiModelProperty(value = "证件类型编码(湖北版权局)")
private int code;
private String value;
private final int code;
private final String value;
//0-身份证 1-营业执照 2-企业法人营业执照 3-组织机构代码证书 4-事业单位法人证书 5-社团法人证书 6-统一社会信用代码 7其他有效证件
@ApiModelProperty(value = "数据库对应的每种证件类型的type")
private int type;
private final int type;
public static CertificatesType getByType(int type) {
for (CertificatesType value : CertificatesType.values()) {
......
......@@ -23,9 +23,9 @@ public enum CopyrightApplyState {
FINAL_JUDGMENT(7, "待终审", ""),
;
private int code;
private String value;
private String msg;
private final int code;
private final String value;
private final String msg;
public static CopyrightApplyState getByState(int state) {
for (CopyrightApplyState stateEnum : CopyrightApplyState.values()) {
......
......@@ -17,6 +17,6 @@ public enum IdCardVerificationResponse {
FAILED4("-4", "证件库服务异常"),
FAILED5("-5", "证件库中无此身份证记录"),
;
private String code;
private String desc;
private final String code;
private final String desc;
}
......@@ -23,8 +23,8 @@ public enum OpusProperty {
ARRANGEMENT(6, "整理"),
OTHER(7, "其他"),
;
private int code;
private String value;
private final int code;
private final String value;
public static List<String> queryAll() {
return Arrays.stream(OpusProperty.values()).map(OpusProperty::getValue).collect(Collectors.toList());
......
......@@ -30,6 +30,6 @@ public enum OrderStatus {
CANCEL(5),
;
private Integer status;
private final Integer status;
}
......@@ -15,8 +15,8 @@ public enum OwnerType {
LEGAL(1, "法人"),
;
private int type;
private String desc;
private final int type;
private final String desc;
public static String getByType(int type) {
return type == PERSON.getType() ? PERSON.getDesc() : LEGAL.getDesc();
......
......@@ -15,8 +15,8 @@ public enum PayScene {
COPYRIGHT(2, "版权申请");
private Integer code;
private String type;
private final Integer code;
private final String type;
public static String getTypeByCode(Integer code) {
for (PayScene value : PayScene.values()) {
......
......@@ -20,6 +20,6 @@ public enum PayType {
/**
* 类型
*/
private Integer code;
private final Integer code;
private final String type;
}
......@@ -21,8 +21,8 @@ public enum PublishStatus {
SUSSED(2, "发行成功"),
FAILED(3, "发行失败");
private Integer code;
private String type;
private final Integer code;
private final String type;
}
......@@ -20,6 +20,6 @@ public enum RefundLaunchChannel {
ADMIN(2);
private Integer code;
private final Integer code;
}
......@@ -16,6 +16,6 @@ public enum RefundStatus {
FAINED(3),
;
private Integer status;
private final Integer status;
}
......@@ -15,8 +15,8 @@ public enum SignatureType {
ALIAS(2, "别名"),
ANONYMOUS(3, "匿名"),
;
private int code;
private String value;
private final int code;
private final String value;
public static int getCode(String value) {
for (SignatureType signatureType : SignatureType.values()) {
......
......@@ -25,8 +25,8 @@ public enum WxPayStatus {
PAYERROR("PAYERROR", "支付失败(仅付款码支付会返回)");
private String status;
private String desc;
private final String status;
private final String desc;
}
......@@ -12,12 +12,13 @@ import com.fzm.common.service.AdminService;
import com.fzm.common.service.UserService;
import com.fzm.common.utils.JwtUtil;
import com.fzm.common.utils.RedisUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
......@@ -27,16 +28,11 @@ import java.util.Date;
* @author tangtuo
* @date 2021/7/13 14:30
*/
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class AuthenticationInterceptor implements HandlerInterceptor {
@Resource
private RedisUtil redisUtil;
@Resource
private UserService userService;
@Resource
private AdminService adminService;
private final RedisUtil redisUtil;
private final UserService userService;
private final AdminService adminService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
......
package com.fzm.common.model;
import com.google.zxing.LuminanceSource;
import java.awt.*;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
public class BufferedImageLuminanceSource extends LuminanceSource {
private final BufferedImage image;
private final int left;
private final int top;
public BufferedImageLuminanceSource(BufferedImage image) {
this(image, 0, 0, image.getWidth(), image.getHeight());
}
public BufferedImageLuminanceSource(BufferedImage image, int left, int top, int width, int height) {
super(width, height);
int sourceWidth = image.getWidth();
int sourceHeight = image.getHeight();
if (left + width > sourceWidth || top + height > sourceHeight) {
throw new IllegalArgumentException("Crop rectangle does not fit within image data.");
}
for (int y = top; y < top + height; y++) {
for (int x = left; x < left + width; x++) {
if ((image.getRGB(x, y) & 0xFF000000) == 0) {
image.setRGB(x, y, 0xFFFFFFFF); // = white
}
}
}
this.image = new BufferedImage(sourceWidth, sourceHeight, BufferedImage.TYPE_BYTE_GRAY);
this.image.getGraphics().drawImage(image, 0, 0, null);
this.left = left;
this.top = top;
}
public byte[] getRow(int y, byte[] row) {
if (y < 0 || y >= getHeight()) {
throw new IllegalArgumentException("Requested row is outside the image: " + y);
}
int width = getWidth();
if (row == null || row.length < width) {
row = new byte[width];
}
image.getRaster().getDataElements(left, top + y, width, 1, row);
return row;
}
public byte[] getMatrix() {
int width = getWidth();
int height = getHeight();
int area = width * height;
byte[] matrix = new byte[area];
image.getRaster().getDataElements(left, top, width, height, matrix);
return matrix;
}
@Override
public boolean isCropSupported() {
return true;
}
@Override
public LuminanceSource crop(int left, int top, int width, int height) {
return new BufferedImageLuminanceSource(image, this.left + left, this.top + top, width, height);
}
@Override
public boolean isRotateSupported() {
return true;
}
@Override
public LuminanceSource rotateCounterClockwise() {
int sourceWidth = image.getWidth();
int sourceHeight = image.getHeight();
AffineTransform transform = new AffineTransform(0.0, -1.0, 1.0, 0.0, 0.0, sourceWidth);
BufferedImage rotatedImage = new BufferedImage(sourceHeight, sourceWidth, BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g = rotatedImage.createGraphics();
g.drawImage(image, transform, null);
g.dispose();
int width = getWidth();
return new BufferedImageLuminanceSource(rotatedImage, top, sourceWidth - (left + width), getHeight(), width);
}
}
\ No newline at end of file
......@@ -23,7 +23,6 @@ public class NotifyConsumer {
private final NotifyMapper notifyMapper;
private final NotifyStateMapper notifyStateMapper;
@RabbitListener(queues = {NotifyConfig.NOTIFY_QUEUE})
public void notifyMessageUser(String content) {
if (StringUtils.isBlank(content)) {
......
......@@ -16,9 +16,8 @@ public interface CopyrightApplyOwnerRelationService extends IService<CopyrightAp
* 根据版权id删除记录
*
* @param copyrightId
* @return
*/
Integer delByCopyrightId(Integer copyrightId);
void delByCopyrightId(Integer copyrightId);
/**
* 根据版权id查询
......
......@@ -149,9 +149,8 @@ public interface CopyrightApplyService extends IService<CopyrightApply> {
*
* @param copyrightId
* @param state
* @return
*/
boolean updateRegisterState(Integer copyrightId, int state);
void updateRegisterState(Integer copyrightId, int state);
void replaceNftHash(String oldNftHash, String newNftHash);
}
......@@ -15,9 +15,8 @@ public interface CopyrightAuthorService extends IService<CopyrightAuthor> {
* 根据版权id删除
*
* @param id
* @return
*/
Integer delByCopyrightId(Integer id);
void delByCopyrightId(Integer id);
/**
* 根据版权id查询作者列表
......
......@@ -14,6 +14,6 @@ public interface CopyrightAuthorityRelationService extends IService<CopyrightAut
*
* @param copyrightId
*/
Integer delByCopyrightId(Integer copyrightId);
void delByCopyrightId(Integer copyrightId);
}
......@@ -24,7 +24,6 @@ public interface CopyrightFileService extends IService<CopyrightFile> {
* 根据版权id删除
*
* @param id
* @return
*/
Integer delByCopyrightId(Integer id, boolean delFile);
void delByCopyrightId(Integer id, boolean delFile);
}
......@@ -126,7 +126,7 @@ public interface NftService extends IService<Nft> {
* @param id
* @return
*/
Integer publish(Integer id);
void publish(Integer id);
/**
* nft转让
......
......@@ -45,7 +45,7 @@ public interface OrderService extends IService<Order> {
* @param orderId
* @param payType
*/
Boolean updatePayType(Long orderId, Integer payType);
void updatePayType(Long orderId, Integer payType);
/**
* 取消订单
......
......@@ -5,7 +5,6 @@ import com.fzm.common.entity.dto.JsapiPayDto;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Map;
/**
......@@ -32,7 +31,7 @@ public interface WxPayService {
*
* @param jsonObject
*/
void processOrder(JSONObject jsonObject) throws GeneralSecurityException, InterruptedException;
void processOrder(JSONObject jsonObject) throws InterruptedException;
String queryOrder(Long orderId) throws IOException, InterruptedException;
......
......@@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.Authority;
import com.fzm.common.mapper.AuthorityMapper;
import com.fzm.common.service.AuthorityService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -15,12 +16,9 @@ import java.util.List;
* @date 2021/12/9 11:42
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class AuthorityServiceImpl extends ServiceImpl<AuthorityMapper, Authority> implements AuthorityService {
@Resource
private AuthorityMapper authorityMapper;
private final AuthorityMapper authorityMapper;
@Override
public List<Authority> getByType(int type) {
......
......@@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.TbCollection;
import com.fzm.common.mapper.CollectionMapper;
import com.fzm.common.service.CollectionService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -15,10 +16,10 @@ import java.util.List;
* @date 2021/7/1 14:36
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CollectionServiceImpl extends ServiceImpl<CollectionMapper, TbCollection> implements CollectionService {
@Resource
private CollectionMapper collectionMapper;
private final CollectionMapper collectionMapper;
@Override
public void deleteByUserIdAndNftId(int userId, Integer nftId) {
......
......@@ -18,19 +18,19 @@ import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.mapper.CommemorateNftMapper;
import com.fzm.common.service.CommemorateNftService;
import com.fzm.common.service.NftChainInfoService;
import com.fzm.common.service.NftService;
import com.fzm.common.service.UserService;
import com.fzm.common.utils.RedisUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock;
import org.redisson.api.RSemaphore;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.Instant;
import java.util.Date;
import java.util.HashMap;
......@@ -43,31 +43,18 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CommemorateNftServiceImpl extends ServiceImpl<CommemorateNftMapper, CommemorateNft> implements CommemorateNftService {
@Resource
NftChainInfoService nftChainInfoService;
@Resource
private NftService nftService;
@Resource
private ParaChainClient paraChainClient;
private final NftService nftService;
private final ParaChainClient paraChainClient;
private final UserService userService;
private final RedissonClient redisson;
private final RedisUtil redisUtil;
@Value("${chain.para.cAddr}")
private String contractAddr;
@Resource
private UserService userService;
@Resource
private RedissonClient redisson;
@Resource
private RedisUtil redisUtil;
@Override
public Integer publish(CommemorateNft commemorateNft) {
User user = userService.getUserByToken();
......
......@@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.CopyrightApplyOwnerRelation;
import com.fzm.common.mapper.CopyrightApplyOwnerRelationMapper;
import com.fzm.common.service.CopyrightApplyOwnerRelationService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -16,16 +17,15 @@ import java.util.List;
* @date 2021/12/13 11:25
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightApplyOwnerRelationServiceImpl extends ServiceImpl<CopyrightApplyOwnerRelationMapper, CopyrightApplyOwnerRelation> implements CopyrightApplyOwnerRelationService {
@Resource
private CopyrightApplyOwnerRelationMapper copyrightApplyOwnerRelationMapper;
private final CopyrightApplyOwnerRelationMapper copyrightApplyOwnerRelationMapper;
@Override
public Integer delByCopyrightId(Integer copyrightId) {
public void delByCopyrightId(Integer copyrightId) {
UpdateWrapper<CopyrightApplyOwnerRelation> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("copyright_id", copyrightId);
return copyrightApplyOwnerRelationMapper.delete(updateWrapper);
copyrightApplyOwnerRelationMapper.delete(updateWrapper);
}
@Override
......
......@@ -28,16 +28,17 @@ import com.fzm.common.utils.CopyrightSignUtil;
import com.fzm.common.utils.ObsUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
......@@ -54,64 +55,27 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, CopyrightApply> implements CopyrightApplyService {
@Resource
private CopyrightApplyMapper copyrightApplyMapper;
@Resource
private CopyrightFileService copyrightFileService;
@Resource
private CopyrightApplyOwnerRelationService copyrightApplyOwnerRelationService;
@Resource
private CopyrightAuthorService copyrightAuthorService;
@Resource
private CopyrightAuthorityRelationService copyrightAuthorityRelationService;
@Resource
private AuthorityService authorityService;
@Resource
private CopyrightOwnerService copyrightOwnerService;
@Resource
private UserService userService;
@Resource
private AuthPersonService authPersonService;
@Resource
private NftService nftService;
@Resource
private ObsUtil obsUtil;
@Resource
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
@Resource
private OpusCategoryService opusCategoryService;
@Resource
private CopyrightProperties copyrightProperties;
@Resource
private Redisson redisson;
@Resource
private DraftService draftService;
@Resource
private OrderService orderService;
@Resource
private WxPayService wxPayService;
@Resource
private NotifyPublisher notifyPublisher;
private final CopyrightApplyMapper copyrightApplyMapper;
private final CopyrightFileService copyrightFileService;
private final CopyrightApplyOwnerRelationService copyrightApplyOwnerRelationService;
private final CopyrightAuthorService copyrightAuthorService;
private final CopyrightAuthorityRelationService copyrightAuthorityRelationService;
private final AuthorityService authorityService;
private final CopyrightOwnerService copyrightOwnerService;
private final UserService userService;
private final AuthPersonService authPersonService;
private final NftService nftService;
private final ObsUtil obsUtil;
private final ThreadPoolTaskExecutor threadPoolTaskExecutor;
private final OpusCategoryService opusCategoryService;
private final CopyrightProperties copyrightProperties;
private final Redisson redisson;
private final DraftService draftService;
private final OrderService orderService;
private final WxPayService wxPayService;
private final NotifyPublisher notifyPublisher;
@Override
......@@ -490,11 +454,11 @@ public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper,
}
@Override
public boolean updateRegisterState(Integer copyrightId, int state) {
public void updateRegisterState(Integer copyrightId, int state) {
CopyrightApply copyrightApply = new CopyrightApply();
copyrightApply.setId(copyrightId);
copyrightApply.setRegisterState(state);
return updateById(copyrightApply);
updateById(copyrightApply);
}
@Override
......
......@@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.CopyrightAuthor;
import com.fzm.common.mapper.CopyrightAuthorMapper;
import com.fzm.common.service.CopyrightAuthorService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -16,16 +17,16 @@ import java.util.List;
* @date 2021/12/9 11:41
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightAuthorServiceImpl extends ServiceImpl<CopyrightAuthorMapper, CopyrightAuthor> implements CopyrightAuthorService {
@Resource
private CopyrightAuthorMapper copyrightAuthorMapper;
private final CopyrightAuthorMapper copyrightAuthorMapper;
@Override
public Integer delByCopyrightId(Integer copyrightId) {
public void delByCopyrightId(Integer copyrightId) {
UpdateWrapper<CopyrightAuthor> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("copyright_id", copyrightId);
return copyrightAuthorMapper.delete(updateWrapper);
copyrightAuthorMapper.delete(updateWrapper);
}
@Override
......
......@@ -5,25 +5,25 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.CopyrightAuthorityRelation;
import com.fzm.common.mapper.CopyrightAuthorityRelationMapper;
import com.fzm.common.service.CopyrightAuthorityRelationService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2021/12/9 11:44
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightAuthorityRelationServiceImpl extends ServiceImpl<CopyrightAuthorityRelationMapper, CopyrightAuthorityRelation> implements CopyrightAuthorityRelationService {
@Resource
private CopyrightAuthorityRelationMapper copyrightAuthorityRelationMapper;
private final CopyrightAuthorityRelationMapper copyrightAuthorityRelationMapper;
@Override
public Integer delByCopyrightId(Integer copyrightId) {
public void delByCopyrightId(Integer copyrightId) {
UpdateWrapper<CopyrightAuthorityRelation> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("copyright_id", copyrightId);
return copyrightAuthorityRelationMapper.delete(updateWrapper);
copyrightAuthorityRelationMapper.delete(updateWrapper);
}
}
......@@ -7,9 +7,10 @@ import com.fzm.common.entity.CopyrightFile;
import com.fzm.common.mapper.CopyrightFileMapper;
import com.fzm.common.service.CopyrightFileService;
import com.fzm.common.utils.ObsUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -17,13 +18,12 @@ import java.util.List;
* @date 2021/12/9 11:43
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightFileServiceImpl extends ServiceImpl<CopyrightFileMapper, CopyrightFile> implements CopyrightFileService {
@Resource
private CopyrightFileMapper copyrightFileMapper;
private final CopyrightFileMapper copyrightFileMapper;
@Resource
private ObsUtil obsUtil;
private final ObsUtil obsUtil;
@Override
......@@ -34,7 +34,7 @@ public class CopyrightFileServiceImpl extends ServiceImpl<CopyrightFileMapper, C
}
@Override
public Integer delByCopyrightId(Integer copyrightId, boolean delFile) {
public void delByCopyrightId(Integer copyrightId, boolean delFile) {
if (delFile) {
List<CopyrightFile> list = getByCopyrightId(copyrightId);
for (CopyrightFile file : list) {
......@@ -44,6 +44,6 @@ public class CopyrightFileServiceImpl extends ServiceImpl<CopyrightFileMapper, C
UpdateWrapper<CopyrightFile> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("copyright_id", copyrightId);
return copyrightFileMapper.delete(updateWrapper);
copyrightFileMapper.delete(updateWrapper);
}
}
......@@ -5,9 +5,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fzm.common.entity.CopyrightOwner;
import com.fzm.common.mapper.CopyrightOwnerMapper;
import com.fzm.common.service.CopyrightOwnerService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -15,10 +16,10 @@ import java.util.List;
* @date 2021/12/9 11:40
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightOwnerServiceImpl extends ServiceImpl<CopyrightOwnerMapper, CopyrightOwner> implements CopyrightOwnerService {
@Resource
private CopyrightOwnerMapper ownerMapper;
private final CopyrightOwnerMapper ownerMapper;
@Override
public List<CopyrightOwner> getByUserId(Integer userId) {
......
......@@ -11,12 +11,13 @@ import com.fzm.common.entity.dto.DraftDTO;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.mapper.DraftMapper;
import com.fzm.common.service.*;
import com.fzm.common.service.DraftService;
import com.fzm.common.utils.ObsUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.Duration;
import java.time.Instant;
import java.util.List;
......@@ -26,25 +27,10 @@ import java.util.List;
* @date 2021/12/10 10:18
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class DraftServiceImpl extends ServiceImpl<DraftMapper, Draft> implements DraftService {
@Resource
private DraftMapper draftMapper;
@Resource
private ObsUtil obsUtil;
@Resource
private CopyrightApplyService copyrightApplyService;
@Resource
private CopyrightFileService copyrightFileService;
@Resource
private CopyrightAuthorityRelationService copyrightAuthorityRelationService;
@Resource
private CopyrightAuthorService copyrightAuthorService;
private final DraftMapper draftMapper;
private final ObsUtil obsUtil;
@Override
public List<Draft> getByUserId(Integer userId) {
......
......@@ -7,35 +7,29 @@ import com.fzm.common.constant.SystemConstant;
import com.fzm.common.entity.EntrustShelf;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.mapper.EntrustShelfMapper;
import com.fzm.common.service.EntrustShelfService;
import com.fzm.common.service.NftService;
import com.fzm.common.utils.JwtUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
/**
* @author tangtuo
* @date 2021/7/5 15:09
*/
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class EntrustShelfServiceImpl extends ServiceImpl<EntrustShelfMapper, EntrustShelf> implements EntrustShelfService {
@Resource
private HttpServletRequest request;
@Resource
private NftService nftService;
private final NftService nftService;
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean submit(EntrustShelf entrustShelf) {
// 查询当前nft是否已提交过申请
QueryWrapper<EntrustShelf> queryWrapper = new QueryWrapper<>();
......@@ -46,13 +40,13 @@ public class EntrustShelfServiceImpl extends ServiceImpl<EntrustShelfMapper, Ent
}
// 修改当前nft的是否已申请的状态为是
nftService.updateEntrust(entrustShelf.getNftHash(), SystemConstant.BOOLEAN_DATA_TRUE);
String authorization = request.getHeader("Authorization");
Integer userId = JwtUtil.getUserIdFromToken(authorization);
Integer userId = LoginUserInfo.getLoginUser().getUserId();
entrustShelf.setUserId(userId);
return this.save(entrustShelf);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean cancel(Integer id) {
EntrustShelf entrustShelf = this.getById(id);
if (entrustShelf == null) {
......
......@@ -23,27 +23,27 @@ import com.fzm.common.enums.AuthStatus;
import com.fzm.common.enums.PublishStatus;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.mapper.NftMapper;
import com.fzm.common.mq.NotifyPublisher;
import com.fzm.common.params.NftTransferParam;
import com.fzm.common.properties.SmsProperties;
import com.fzm.common.service.*;
import com.fzm.common.utils.JwtUtil;
import com.fzm.common.utils.ObsUtil;
import com.fzm.common.utils.RedisUtil;
import com.fzm.common.utils.SmsUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.time.Instant;
import java.util.*;
import java.util.concurrent.ExecutionException;
......@@ -55,58 +55,29 @@ import java.util.stream.Collectors;
*/
@Slf4j
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftService {
@Resource
private ParaChainClient paraChainClient;
@Resource
RedisUtil redisUtil;
@Resource
private UserService userService;
@Resource
private NftMapper nftMapper;
@Resource
private CategoryService categoryService;
@Resource
private CollectionService collectionService;
@Resource
private NftTransferRecordService nftTransferRecordService;
@Resource
private SmsUtil smsUtil;
@Resource
private SmsProperties smsProperties;
@Resource
private RabbitTemplate rabbitTemplate;
@Resource
private HttpServletRequest request;
private final ParaChainClient paraChainClient;
private final RedisUtil redisUtil;
private final UserService userService;
private final NftMapper nftMapper;
private final CategoryService categoryService;
private final CollectionService collectionService;
private final NftTransferRecordService nftTransferRecordService;
private final SmsUtil smsUtil;
private final SmsProperties smsProperties;
private final RabbitTemplate rabbitTemplate;
private final CopyrightApplyService copyrightApplyService;
private final ObsUtil obsUtil;
private final NotifyPublisher notifyPublisher;
@Value("${chain.para.cAddr}")
private String contractAddr;
@Resource
private CopyrightApplyService copyrightApplyService;
@Resource
private ObsUtil obsUtil;
@Resource
private NotifyPublisher notifyPublisher;
//private static String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getUserTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
private static String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
private static final String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
@Override
@Transactional(rollbackFor = Exception.class)
public Integer saveNft(Nft nft) {
User user = userService.getUserByToken();
if (!AuthStatus.SUCCESS.getStatus().equals(user.getAuthStatus())) {
......@@ -119,7 +90,8 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
}
@Override
public Integer publish(Integer id) {
@Transactional(rollbackFor = Exception.class)
public void publish(Integer id) {
Nft nft = getById(id);
User user = userService.getUserByWallet(nft.getPublishAddress());
String wallet = user.getWallet();
......@@ -153,10 +125,10 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
// 给mq发送一条消息,异步确认发行结果
NftPublishMsg nftPublishMsg = new NftPublishMsg(hash, id, tokenId);
rabbitTemplate.convertAndSend("nft-exchange", "nft.publish", nftPublishMsg);
return nft.getId();
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean transfer(NftTransferParam param) {
Nft nft = getById(param.getId());
if (nft == null) {
......@@ -252,6 +224,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateEntrust(String nftHash, Integer isEntrust) {
Nft nft = new Nft();
nft.setIsEntrust(isEntrust);
......@@ -261,6 +234,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(Integer id) {
Nft nft = this.getById(id);
if (nft != null && StringUtils.isNotBlank(nft.getCover())) {
......@@ -271,8 +245,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
@Override
public List<Nft> getPublishingList(Integer status) {
String token = request.getHeader("Authorization");
Integer userId = JwtUtil.getUserIdFromToken(token);
Integer userId = LoginUserInfo.getLoginUser().getUserId();
QueryWrapper<Nft> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", userId).
eq("publish_status", status).
......@@ -393,8 +366,9 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean collection(Integer id) {
int userId = JwtUtil.getUserIdFromToken(request.getHeader("Authorization"));
int userId = LoginUserInfo.getLoginUser().getUserId();
String key = RedisConstant.COLLECTION_USER_PREFIX + userId;
// 如果用户收藏的nft已经存在列表里,那么就是取消收藏
if (redisUtil.sIsMember(key, id.toString())) {
......@@ -414,7 +388,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
@Override
public List<CollectionNftVo> getCollectionList() {
int userId = JwtUtil.getUserIdFromToken(request.getHeader("Authorization"));
int userId = LoginUserInfo.getLoginUser().getUserId();
// 从redis里获取当前用户的收藏列表
Set<String> set = redisUtil.setMembers(RedisConstant.COLLECTION_USER_PREFIX + userId);
List<Integer> list;
......@@ -489,6 +463,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean onShelf(Integer id) {
Nft nft = new Nft();
nft.setStatus(SystemConstant.BOOLEAN_DATA_TRUE);
......@@ -497,6 +472,7 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean offShelf(Integer id) {
Nft nft = new Nft();
nft.setStatus(SystemConstant.BOOLEAN_DATA_FALSE);
......
......@@ -11,10 +11,11 @@ import com.fzm.common.entity.vo.NftTransferRecordVo;
import com.fzm.common.mapper.NftTransferRecordMapper;
import com.fzm.common.service.NftTransferRecordService;
import com.fzm.common.service.UserService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -22,13 +23,10 @@ import java.util.List;
* @date 2021/6/28 11:29
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftTransferRecordServiceImpl extends ServiceImpl<NftTransferRecordMapper, NftTransferRecord> implements NftTransferRecordService {
@Resource
private NftTransferRecordMapper nftTransferRecordMapper;
@Resource
private UserService userService;
private final NftTransferRecordMapper nftTransferRecordMapper;
private final UserService userService;
@Override
public List<NftTransferRecordVo> getTransferRecordList(String nftHash, String fromAddress, String toAddress, String startDate, String endDate) {
......
......@@ -12,16 +12,16 @@ import com.fzm.common.enums.PayScene;
import com.fzm.common.enums.PayType;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.mapper.OrderMapper;
import com.fzm.common.service.*;
import com.fzm.common.utils.JwtUtil;
import com.fzm.common.utils.SnowflakeUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
......@@ -34,31 +34,15 @@ import java.util.List;
*/
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
@Resource
private NftService nftService;
@Resource
private CopyrightApplyService copyrightApplyService;
@Resource
private SnowflakeUtil snowflakeUtil;
@Resource
private HttpServletRequest request;
@Resource
private RabbitTemplate rabbitTemplate;
@Resource
private OrderMapper orderMapper;
@Resource
private WxPayService wxPayService;
@Resource
private ChargeService chargeService;
private final NftService nftService;
private final CopyrightApplyService copyrightApplyService;
private final SnowflakeUtil snowflakeUtil;
private final RabbitTemplate rabbitTemplate;
private final OrderMapper orderMapper;
private final WxPayService wxPayService;
private final ChargeService chargeService;
@Override
public Order getByPaySceneAndProductId(Integer payScene, Integer productId, Integer orderStatus) {
......@@ -107,7 +91,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
order.setOrderName(orderName);
order.setFee(orderDto.getFee());
order.setProductId(productId);
order.setUserId(JwtUtil.getUserIdFromToken(request.getHeader("Authorization")));
order.setUserId(LoginUserInfo.getLoginUser().getUserId());
order.setCreateDate(new Date());
order.setUpdateDate(new Date());
Integer orderStatus;
......@@ -124,11 +108,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
}
@Override
public Boolean updatePayType(Long orderId, Integer payType) {
public void updatePayType(Long orderId, Integer payType) {
Order o = new Order();
o.setId(orderId);
o.setPayType(payType);
return updateById(o);
updateById(o);
}
@Override
......@@ -150,7 +134,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
@Override
public List<OrderVo> listOrder(Integer payScene, Integer orderStatus) {
Integer userId = JwtUtil.getUserIdFromToken(request.getHeader("Authorization"));
Integer userId = LoginUserInfo.getLoginUser().getUserId();
return orderMapper.getByPayScene(payScene, userId, orderStatus);
}
......
......@@ -10,11 +10,12 @@ import com.fzm.common.mapper.PaymentMapper;
import com.fzm.common.service.PaymentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -23,10 +24,9 @@ import java.util.List;
*/
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PaymentServiceImpl extends ServiceImpl<PaymentMapper, Payment> implements PaymentService {
@Resource
private PaymentMapper paymentMapper;
private final PaymentMapper paymentMapper;
@Override
......
......@@ -12,11 +12,12 @@ import com.fzm.common.service.RefundService;
import com.fzm.common.service.WxPayService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
......@@ -26,13 +27,11 @@ import java.util.List;
*/
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RefundServiceImpl extends ServiceImpl<RefundMapper, Refund> implements RefundService {
@Resource
private WxPayService wxPayService;
@Resource
private RefundMapper refundMapper;
private final WxPayService wxPayService;
private final RefundMapper refundMapper;
@Override
public Refund getByOrderId(Long orderId) {
......
......@@ -6,10 +6,11 @@ import com.fzm.common.service.OrderService;
import com.fzm.common.service.SmsService;
import com.fzm.common.service.UserService;
import com.fzm.common.utils.SmsUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
/**
......@@ -17,16 +18,11 @@ import java.math.BigDecimal;
* @date 2022/2/8 14:12
*/
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class SmsServiceImpl implements SmsService {
@Resource
private UserService userService;
@Resource
private SmsUtil smsUtil;
@Resource
private OrderService orderService;
private final UserService userService;
private final SmsUtil smsUtil;
private final OrderService orderService;
@Override
@Async("threadPoolTaskExecutor")
......
......@@ -20,6 +20,7 @@ import com.fzm.common.enums.AuthType;
import com.fzm.common.enums.IdCardVerificationResponse;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.mapper.UserMapper;
import com.fzm.common.mq.NotifyPublisher;
import com.fzm.common.params.LoginParam;
......@@ -27,7 +28,10 @@ import com.fzm.common.properties.DebugProperties;
import com.fzm.common.properties.SmsProperties;
import com.fzm.common.service.AuthPersonService;
import com.fzm.common.service.UserService;
import com.fzm.common.utils.*;
import com.fzm.common.utils.ObsUtil;
import com.fzm.common.utils.RedisUtil;
import com.fzm.common.utils.SmsUtil;
import com.fzm.common.utils.TencentApi;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
......@@ -35,15 +39,16 @@ import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.faceid.v20180301.FaceidClient;
import com.tencentcloudapi.faceid.v20180301.models.IdCardOCRVerificationRequest;
import com.tencentcloudapi.faceid.v20180301.models.IdCardOCRVerificationResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.Base64;
......@@ -56,40 +61,19 @@ import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
@Resource
private UserMapper userMapper;
@Resource
private PasswordEncoder passwordEncoder;
@Resource
private SmsProperties smsProperties;
@Resource
private SmsUtil smsUtil;
@Resource
private RedisUtil redisUtil;
@Resource
private AuthPersonService authPersonService;
@Resource
private ParaChainClient paraClient;
@Resource
private HttpServletRequest request;
@Resource
private ObsUtil obsUtil;
@Resource
private DebugProperties debugProperties;
@Resource
private NotifyPublisher notifyPublisher;
private final UserMapper userMapper;
private final PasswordEncoder passwordEncoder;
private final SmsProperties smsProperties;
private final SmsUtil smsUtil;
private final RedisUtil redisUtil;
private final AuthPersonService authPersonService;
private final ParaChainClient paraClient;
private final HttpServletRequest request;
private final ObsUtil obsUtil;
private final DebugProperties debugProperties;
private final NotifyPublisher notifyPublisher;
@Override
......@@ -164,7 +148,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
if (StringUtils.isBlank(token)) {
throw GlobalException.newException(ResultCode.UNAUTHORIZED, "您还没有登录,请先登录");
}
Integer userId = JwtUtil.getUserIdFromToken(token);
Integer userId = LoginUserInfo.getLoginUser().getUserId();
return getById(userId);
}
......@@ -329,7 +313,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
// 输出json格式的字符串回包
System.out.println(IdCardOCRVerificationResponse.toJsonString(resp));
} catch (TencentCloudSDKException e) {
System.out.println(e.toString());
System.out.println(e);
}
}
}
......@@ -17,6 +17,7 @@ import com.fzm.common.properties.WxPayProperties;
import com.fzm.common.service.*;
import com.fzm.common.utils.SnowflakeUtil;
import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
......@@ -28,11 +29,11 @@ import org.apache.http.util.EntityUtils;
import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Base64Utils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
......@@ -53,38 +54,19 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@Service
@Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WxPayServiceImpl implements WxPayService {
@Resource
private CloseableHttpClient httpClient;
@Resource
private WxPayProperties wxPayProperties;
@Resource
private PrivateKey wxPrivateKey;
@Resource
private OrderService orderService;
@Resource
private Redisson redisson;
@Resource
private PaymentService paymentService;
@Resource
private RabbitTemplate rabbitTemplate;
@Resource
private SnowflakeUtil snowflakeUtil;
@Resource
private RefundService refundService;
@Resource
private SmsService smsService;
private final CloseableHttpClient httpClient;
private final WxPayProperties wxPayProperties;
private final PrivateKey wxPrivateKey;
private final OrderService orderService;
private final Redisson redisson;
private final PaymentService paymentService;
private final RabbitTemplate rabbitTemplate;
private final SnowflakeUtil snowflakeUtil;
private final RefundService refundService;
private final SmsService smsService;
public Map<String, Object> payJsapi(JsapiPayDto jsapiPayDto) throws Exception {
RLock lock = redisson.getLock("pay-" + jsapiPayDto.getOrderId());
......
package com.fzm.common.utils;
import cn.hutool.crypto.SecureUtil;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
import java.util.TreeMap;
......@@ -10,10 +9,8 @@ import java.util.TreeMap;
* @author tangtuo
* @date 2021/12/23 11:40
*/
@Slf4j
public class CopyrightSignUtil {
public static String generateSign(TreeMap<String, String> param) {
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, String> entry : param.entrySet()) {
......@@ -23,7 +20,6 @@ public class CopyrightSignUtil {
sb.append(key).append("=").append(value).append("&");
}
String signStr = sb.deleteCharAt(sb.length() - 1).toString();
log.info("signStr: {}", signStr);
return SecureUtil.md5(signStr);
}
}
......@@ -2,7 +2,6 @@ package com.fzm.common.utils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.lang.reflect.Type;
......@@ -10,8 +9,8 @@ import java.lang.reflect.Type;
public class JsonUtil {
private static Gson gson;
private static JsonParser jsonParser;
private static final Gson gson;
private static final JsonParser jsonParser;
private JsonUtil() {
}
......@@ -48,12 +47,5 @@ public class JsonUtil {
public static String toJson(Object object) {
return gson.toJson(object);
}
/**
* String转为jsonObject
*/
public static JsonObject toJsonObject(String string) {
return jsonParser.parse(string).getAsJsonObject();
}
}
......@@ -21,7 +21,6 @@ import java.util.Map;
*/
public class JwtUtil {
private static final String CLAIM_KEY_USERNAME = "sub";
private static final String CLAIM_KEY_CREATED = "created";
private static final String CLAIM_KEY_USERID = "userId";
private static final String CLAIM_KEY_APP_ID = "appId";
......@@ -45,10 +44,9 @@ public class JwtUtil {
* 从token中获取JWT中的负载
*/
private static Claims getClaimsFromToken(String token) {
Claims claims = null;
token = token.replace(TOKEN_PREFIX, "");
try {
claims = Jwts.parser()
return Jwts.parser()
.setSigningKey(SECRET)
.parseClaimsJws(token)
.getBody();
......@@ -57,7 +55,6 @@ public class JwtUtil {
} catch (Exception e) {
throw GlobalException.newException(ResultCode.UNAUTHORIZED, e.getMessage());
}
return claims;
}
/**
......@@ -110,12 +107,12 @@ public class JwtUtil {
}
}
/**
* 验证token是否还有效
*
* @param token 客户端传入的token
* @param userDetails 从数据库中查询出来的用户信息
*/
// /**
// * 验证token是否还有效
// *
// * @param token 客户端传入的token
// * @param userDetails 从数据库中查询出来的用户信息
// */
/* public static boolean validateToken(String token, UserDetails userDetails) {
String username = getUserNameFromToken(token);
return username.equals(userDetails.getUsername()) && !isTokenExpired(token);
......
......@@ -8,11 +8,13 @@ import com.obs.services.ObsClient;
import com.obs.services.model.DeleteObjectResult;
import com.obs.services.model.ObsObject;
import com.obs.services.model.PutObjectResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
......@@ -28,16 +30,11 @@ import java.net.URLEncoder;
*/
@Slf4j
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ObsUtil {
@Resource
private ObsClient obsClient;
@Resource
private ObsProperties obsProperties;
@Resource
private HttpServletResponse response;
private final ObsClient obsClient;
private final ObsProperties obsProperties;
private final HttpServletResponse response;
/**
* 上传对象
......@@ -46,7 +43,11 @@ public class ObsUtil {
* @return
*/
public String putObject(MultipartFile file) throws IOException {
String objectName = IdUtil.simpleUUID().concat("/").concat(file.getOriginalFilename().replaceAll(" ", ""));
String originalFilename = file.getOriginalFilename();
if (StringUtils.isBlank(originalFilename)) {
throw GlobalException.newException(ResultCode.VALIDATE_FAILED, "文件名不能为空");
}
String objectName = IdUtil.simpleUUID().concat("/").concat(originalFilename.replaceAll(" ", ""));
obsClient.putObject(obsProperties.getBucket(), objectName, file.getInputStream());
return String.format("https://%s.%s/%s", obsProperties.getBucket(), obsProperties.getEndPoint(), objectName);
}
......
package com.fzm.common.utils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.DataType;
import org.springframework.data.redis.core.Cursor;
......@@ -13,13 +14,12 @@ import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RedisUtil {
private final StringRedisTemplate redisTemplate;
@Autowired
private StringRedisTemplate redisTemplate;
/** -------------------key相关操作--------------------- */
/* -------------------key相关操作--------------------- */
/**
* 删除key
......@@ -174,7 +174,7 @@ public class RedisUtil {
return redisTemplate.type(key);
}
/** -------------------string相关操作--------------------- */
/* -------------------string相关操作--------------------- */
/**
* 设置指定 key 的值
......@@ -241,17 +241,6 @@ public class RedisUtil {
}
/**
* 设置ASCII码, 字符串'a'的ASCII码是97, 转为二进制是'01100001', 此方法是将二进制第offset位值变为value
*
* @param key 位置
* @param value 值,true为1, false为0
* @return
*/
public boolean setBit(String key, long offset, boolean value) {
return redisTemplate.opsForValue().setBit(key, offset, value);
}
/**
* 将值 value 关联到 key ,并将 key 的过期时间设为 timeout
*
* @param key
......@@ -265,17 +254,6 @@ public class RedisUtil {
}
/**
* 只有在 key 不存在时设置 key 的值
*
* @param key
* @param value
* @return 之前已经存在返回false, 不存在返回true
*/
public boolean setIfAbsent(String key, String value) {
return redisTemplate.opsForValue().setIfAbsent(key, value);
}
/**
* 用 value 参数覆写给定 key 所储存的字符串值,从偏移量 offset 开始
*
* @param key
......@@ -305,15 +283,6 @@ public class RedisUtil {
redisTemplate.opsForValue().multiSet(maps);
}
/**
* 同时设置一个或多个 key-value 对,当且仅当所有给定 key 都不存在
*
* @param maps
* @return 之前已经存在返回false, 不存在返回true
*/
public boolean multiSetIfAbsent(Map<String, String> maps) {
return redisTemplate.opsForValue().multiSetIfAbsent(maps);
}
/**
* 增加(自增长), 负数则为自减
......@@ -344,7 +313,7 @@ public class RedisUtil {
return redisTemplate.opsForValue().append(key, value);
}
/** -------------------hash相关操作------------------------- */
/* -------------------hash相关操作------------------------- */
/**
* 获取存储在哈希表中指定字段的值
......@@ -485,7 +454,7 @@ public class RedisUtil {
return redisTemplate.opsForHash().scan(key, options);
}
/** ------------------------list相关操作---------------------------- */
/* ------------------------list相关操作---------------------------- */
/**
* 通过索引获取列表中的元素
......@@ -728,7 +697,7 @@ public class RedisUtil {
return redisTemplate.opsForList().size(key);
}
/** --------------------set相关操作-------------------------- */
/* --------------------set相关操作-------------------------- */
/**
* set添加元素
......@@ -991,7 +960,7 @@ public class RedisUtil {
return redisTemplate.opsForSet().scan(key, options);
}
/**------------------zSet相关操作--------------------------------*/
/*------------------zSet相关操作--------------------------------*/
/**
* 添加元素,有序集合是按照元素的score值由小到大排列
......
......@@ -11,31 +11,29 @@ import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.properties.DebugProperties;
import com.fzm.common.properties.SmsProperties;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
/**
* @author tangtuo
* @date 2021/6/28 16:02
*/
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class SmsUtil {
@Resource
private SmsProperties smsProperties;
@Resource
private DebugProperties debugProperties;
private final SmsProperties smsProperties;
private final DebugProperties debugProperties;
public static String getStringToSignOfStr(Map<String, Object> map) {
TreeMap<String, String> treeMap = new TreeMap<>();
Iterator<String> iterator = map.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next();
for (String key : map.keySet()) {
treeMap.put(key, map.get(key).toString());
}
StringBuilder sb = new StringBuilder();
......@@ -99,11 +97,10 @@ public class SmsUtil {
*
* @param mobile
* @param fee
* @return
*/
public Boolean sendRefundSms(String mobile, String fee) {
public void sendRefundSms(String mobile, String fee) {
if (debugProperties.getSms()) {
return true;
return;
}
String timestamp = getTimestamp();
......@@ -119,13 +116,12 @@ public class SmsUtil {
header("FZM-Ca-AppKey", smsProperties.getAppKey()).
header("FZM-Ca-Signature", sign).form(params).execute();
if (response == null || StringUtils.isBlank(response.body())) {
return false;
return;
}
JSONObject jsonObject = JSONUtil.parseObj(response.body());
if (jsonObject.get("code", Integer.class) != HttpStatus.HTTP_OK) {
throw GlobalException.newException(ResultCode.CODE_ERROR, jsonObject.getStr("message"));
}
return true;
}
/**
......
......@@ -4,23 +4,20 @@ import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.net.NetUtil;
import cn.hutool.core.util.IdUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
@Component
@Slf4j
public class SnowflakeUtil {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private long workerId = 0;//为终端ID
private long datacenterId = 1;//数据中心ID
private Snowflake snowflake = IdUtil.createSnowflake(workerId, datacenterId);
private final long datacenterId = 1;//数据中心ID
private final Snowflake snowflake = IdUtil.createSnowflake(workerId, datacenterId);
@PostConstruct
public void init() {
workerId = NetUtil.ipv4ToLong(NetUtil.getLocalhostStr());
log.info("当前机器的workId:{}", workerId);
}
public long snowflakeId() {
......
......@@ -33,8 +33,7 @@ public class TencentApi {
req.setImageBase64(imageBase64);
// 返回的resp是一个IdCardOCRVerificationResponse的实例,与请求对象对应
try {
IdCardOCRVerificationResponse resp = client.IdCardOCRVerification(req);
return resp;
return client.IdCardOCRVerification(req);
} catch (TencentCloudSDKException e) {
throw GlobalException.newException(ResultCode.ID_CARD_VERIFICATION_ERROR, "实名认证失败,失败原因: " + e.getMessage());
}
......
package com.fzm.portal.aop;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
......@@ -8,6 +9,7 @@ import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ModelAttribute;
......@@ -15,7 +17,6 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
......@@ -32,12 +33,12 @@ import java.util.Map;
@Order(1)
@Component
@Aspect
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class LogAop {
@Resource
private HttpServletRequest request;
private final HttpServletRequest request;
private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
private static final ThreadLocal<Long> threadLocal = new ThreadLocal<>();
@Pointcut(value = "execution(public * com.fzm.portal.controller..*.*(..))")
public void pointCut() {
......
......@@ -6,12 +6,13 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.AuthorityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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 javax.annotation.Resource;
import java.util.List;
/**
......@@ -21,10 +22,10 @@ import java.util.List;
@RestController
@RequestMapping("/authority")
@Api(tags = "权力")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class AuthorityController {
@Resource
private AuthorityService authorityService;
private final AuthorityService authorityService;
@GetMapping("/list")
......
......@@ -5,11 +5,12 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.BannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -19,10 +20,10 @@ import java.util.List;
@RestController
@RequestMapping("/banner")
@Api(tags = "banner页管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class BannerController {
@Resource
private BannerService bannerService;
private final BannerService bannerService;
@GetMapping("/list")
@ApiOperation(value = "查询banner页列表")
......
......@@ -5,11 +5,12 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -19,10 +20,10 @@ import java.util.List;
@RestController
@RequestMapping(value = "/category")
@Api(tags = "类目管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CategoryController {
@Resource
private CategoryService categoryService;
private final CategoryService categoryService;
@GetMapping("/list")
@ApiOperation(value = "查询所有类目信息")
......
......@@ -7,13 +7,13 @@ import com.fzm.common.service.ChargeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/1/25 10:13
......@@ -22,10 +22,10 @@ import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/charge")
@Api(tags = "收费管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ChargeController {
@Resource
private ChargeService chargeService;
private final ChargeService chargeService;
@GetMapping("/fee/{type}")
......
......@@ -7,9 +7,10 @@ import com.fzm.common.service.NftService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -19,10 +20,10 @@ import java.util.List;
@RestController
@RequestMapping(value = "/collection")
@Api(tags = "收藏")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CollectionController {
@Resource
private NftService nftService;
private final NftService nftService;
@Authentication
......
......@@ -18,13 +18,14 @@ import com.fzm.common.utils.RedisUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RSemaphore;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
......@@ -35,25 +36,14 @@ import java.util.List;
@RestController
@RequestMapping(value = "/commemorate/nft")
@Api(tags = "纪念版nft")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CommemorateNftController {
@Resource
private CommemorateNftService commemorateNftService;
@Resource
private ObsUtil obsUtil;
@Resource
private UserService userService;
@Resource
private CategoryService categoryService;
@Resource
private RedissonClient redisson;
@Resource
private RedisUtil redisUtil;
private final CommemorateNftService commemorateNftService;
private final ObsUtil obsUtil;
private final UserService userService;
private final CategoryService categoryService;
private final RedissonClient redisson;
private final RedisUtil redisUtil;
@Authentication
@PostMapping("/publish")
......@@ -67,7 +57,11 @@ public class CommemorateNftController {
if (file == null || cover == null) {
throw GlobalException.newException(ResultCode.VALIDATE_FAILED, "文件不能为空");
}
String coverName = cover.getOriginalFilename().toLowerCase();
String originalFilename = cover.getOriginalFilename();
if (StringUtils.isBlank(originalFilename)) {
throw GlobalException.newException(ResultCode.VALIDATE_FAILED, "文件名不能为空");
}
String coverName = originalFilename.toLowerCase();
if (!coverName.endsWith(".png") && !coverName.endsWith(".jpg")) {
throw GlobalException.newException(ResultCode.FILE_UPLOAD_ERROR, "封面类型有误");
}
......
......@@ -9,16 +9,17 @@ import com.fzm.common.entity.vo.CopyrightVo;
import com.fzm.common.enums.CopyrightApplyState;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.CopyrightApplyService;
import com.fzm.common.utils.JwtUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutionException;
......@@ -30,10 +31,10 @@ import java.util.concurrent.ExecutionException;
@RestController
@Api(tags = "版权申请")
@RequestMapping("/copyright/apply")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightApplyController {
@Resource
private CopyrightApplyService copyrightApplyService;
private final CopyrightApplyService copyrightApplyService;
@Authentication
@PostMapping("/submit")
......@@ -47,8 +48,8 @@ public class CopyrightApplyController {
@Authentication
@GetMapping("/list")
@ApiOperation(value = "查询版权登记列表")
public ResponseModel<List<CopyrightApply>> list(@RequestHeader(value = "Authorization") String token, @ApiParam("状态 0-全部 1-进行中 2-已完成") @RequestParam Integer state) {
Integer userId = JwtUtil.getUserIdFromToken(token);
public ResponseModel<List<CopyrightApply>> list(@ApiParam("状态 0-全部 1-进行中 2-已完成") @RequestParam Integer state) {
Integer userId = LoginUserInfo.getLoginUser().getUserId();
List<CopyrightApply> list = copyrightApplyService.list(userId, state);
return ResponseModel.success(list);
}
......
......@@ -8,12 +8,14 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.utils.ObsUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
/**
......@@ -24,12 +26,12 @@ import java.io.IOException;
@Authentication
@RestController
@RequestMapping(value = "/copyright/file")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightFileController {
private static final long maxSize = 1024 * 1024 * 200;
@Resource
private ObsUtil obsUtil;
private final ObsUtil obsUtil;
@PostMapping("/upload")
@ApiOperation(value = "上传版权申请附件")
......@@ -39,6 +41,9 @@ public class CopyrightFileController {
throw GlobalException.newException(ResultCode.FILE_UPLOAD_ERROR, "单个文件最大支持200M");
}
String fileName = file.getOriginalFilename();
if (StringUtils.isBlank(fileName)) {
throw GlobalException.newException(ResultCode.VALIDATE_FAILED, "文件名不能为空");
}
String fileSuffix = fileName.substring(fileName.lastIndexOf(".") + 1);
if (!FileSuffix.validFileType(fileSuffix)) {
throw GlobalException.newException(ResultCode.FILE_UPLOAD_ERROR, "不支持当前上传的文件类型");
......
......@@ -5,16 +5,17 @@ import com.fzm.common.entity.CopyrightOwner;
import com.fzm.common.enums.OwnerType;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.CopyrightOwnerService;
import com.fzm.common.utils.JwtUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -25,14 +26,14 @@ import java.util.List;
@RestController
@RequestMapping("/copyright/owner")
@Api(tags = "著作权人")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightOwnerController {
@Resource
private CopyrightOwnerService copyrightOwnerService;
private final CopyrightOwnerService copyrightOwnerService;
@PostMapping(value = "/add")
@ApiOperation(value = "新增著作权人")
public ResponseModel<Integer> add(@RequestHeader String Authorization, @Validated @RequestBody CopyrightOwner owner) {
public ResponseModel<Integer> add(@Validated @RequestBody CopyrightOwner owner) {
// 如果著作权人是个人的话,身份证正反面照片 著作权人手持身份证照片等信息必传
if (owner.getType().equals(OwnerType.PERSON.getType())) {
if (StringUtils.isAnyBlank(owner.getBackPhoto(), owner.getPositivePhoto(), owner.getPersonalPhoto())) {
......@@ -44,7 +45,7 @@ public class CopyrightOwnerController {
throw GlobalException.newException(ResultCode.VALIDATE_FAILED);
}
}
Integer userId = JwtUtil.getUserIdFromToken(Authorization);
Integer userId = LoginUserInfo.getLoginUser().getUserId();
owner.setUserId(userId);
copyrightOwnerService.save(owner);
return ResponseModel.success(owner.getId());
......@@ -52,8 +53,8 @@ public class CopyrightOwnerController {
@GetMapping(value = "/list")
@ApiOperation(value = "获取我的著作权人列表")
public ResponseModel<List<CopyrightOwner>> list(@RequestHeader(value = "Authorization") String token) {
Integer userId = JwtUtil.getUserIdFromToken(token);
public ResponseModel<List<CopyrightOwner>> list() {
Integer userId = LoginUserInfo.getLoginUser().getUserId();
List<CopyrightOwner> list = copyrightOwnerService.getByUserId(userId);
return ResponseModel.success(list);
}
......
......@@ -3,14 +3,15 @@ package com.fzm.portal.controller;
import com.fzm.common.annotation.Authentication;
import com.fzm.common.entity.Draft;
import com.fzm.common.entity.dto.DraftDTO;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.DraftService;
import com.fzm.common.utils.JwtUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -21,23 +22,23 @@ import java.util.List;
@RestController
@RequestMapping("/Draft")
@Api(tags = "草稿管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class DraftController {
@Resource
private DraftService draftService;
private final DraftService draftService;
@PostMapping("/save")
@ApiOperation(value = "保存草稿")
public ResponseModel<Integer> save(@RequestHeader(value = "Authorization") String token, @RequestBody DraftDTO draft) {
draft.setUserId(JwtUtil.getUserIdFromToken(token));
public ResponseModel<Integer> save(@RequestBody DraftDTO draft) {
draft.setUserId(LoginUserInfo.getLoginUser().getUserId());
Integer id = draftService.saveDraft(draft);
return ResponseModel.success(id);
}
@GetMapping("/list")
@ApiOperation(value = "查询我的草稿列表")
public ResponseModel<List<Draft>> list(@RequestHeader(value = "Authorization") String token) {
Integer userId = JwtUtil.getUserIdFromToken(token);
public ResponseModel<List<Draft>> list() {
Integer userId = LoginUserInfo.getLoginUser().getUserId();
List<Draft> list = draftService.getByUserId(userId);
return ResponseModel.success(list);
}
......
......@@ -8,11 +8,11 @@ import com.fzm.common.valid.InsertGroup;
import com.fzm.common.valid.UpdateGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/1/11 17:19
......@@ -21,11 +21,10 @@ import javax.annotation.Resource;
@RestController
@RequestMapping("/entrust/shelf")
@Api(tags = "委托上架")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class EntrustShelfController {
@Resource
private EntrustShelfService entrustShelfService;
private final EntrustShelfService entrustShelfService;
@PostMapping("/submit")
......
......@@ -6,12 +6,13 @@ import com.fzm.common.service.FileTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -21,10 +22,10 @@ import java.util.List;
@RestController
@RequestMapping("/file/template")
@Api(tags = "文件模板")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class FileTemplateController {
@Resource
private FileTemplateService fileTemplateService;
private final FileTemplateService fileTemplateService;
@GetMapping("/list/{type}")
@ApiOperation(value = "根据类型查询文件列表")
......
......@@ -11,23 +11,23 @@ import com.fzm.common.entity.vo.NftVo;
import com.fzm.common.enums.CopyrightApplyState;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.model.ResponseModel;
import com.fzm.common.params.NftTransferParam;
import com.fzm.common.service.NftService;
import com.fzm.common.service.UserService;
import com.fzm.common.utils.JsonUtil;
import com.fzm.common.utils.JwtUtil;
import com.fzm.common.utils.QRCodeUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
......@@ -42,17 +42,11 @@ import java.util.concurrent.ExecutionException;
@RestController
@RequestMapping(value = "/nft")
@Api(tags = "nft管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftController {
@Resource
private NftService nftService;
@Resource
private UserService userService;
@Resource
private HttpServletRequest request;
private final NftService nftService;
private final UserService userService;
@Authentication
@PostMapping("/save")
......@@ -95,8 +89,8 @@ public class NftController {
@Authentication
@GetMapping("/list/current")
@ApiOperation(value = "获取我的nft列表")
public ResponseModel<Map<String, Object>> listCurrent(@ApiParam(value = "类目id,查询全部的时候传null") @RequestParam(required = false) Integer categoryId) throws Exception {
Integer userId = JwtUtil.getUserIdFromToken(request.getHeader("Authorization"));
public ResponseModel<Map<String, Object>> listCurrent(@ApiParam(value = "类目id,查询全部的时候传null") @RequestParam(required = false) Integer categoryId) {
Integer userId = LoginUserInfo.getLoginUser().getUserId();
List<CollectionNftVo> list = nftService.listCurrent(categoryId, userId);
User user = userService.getById(userId);
// 生成二维码
......@@ -132,12 +126,12 @@ public class NftController {
@Authentication
@GetMapping("/certificate/{id}")
@ApiOperation(value = "nft证书")
public ResponseModel<NftCertificateVo> certificate(@PathVariable Integer id, @RequestHeader String Authorization) throws Exception {
public ResponseModel<NftCertificateVo> certificate(@PathVariable Integer id) {
Nft nft = nftService.getById(id);
if (nft == null) {
throw GlobalException.newException(ResultCode.DATA_ERROR, "没找到此nft的详情");
}
int userId = JwtUtil.getUserIdFromToken(Authorization);
int userId = LoginUserInfo.getLoginUser().getUserId();
if (!nft.getUserId().equals(userId)) {
throw GlobalException.newException(ResultCode.FORBIDDEN, "您无权查看别人的nft证书");
}
......@@ -176,8 +170,8 @@ public class NftController {
@Authentication
@ApiOperation(value = "查询用户还未成功申请版权的nft列表")
@GetMapping(value = "/list/copyright")
public ResponseModel<List<CollectionNftVo>> listCopyright(@RequestHeader(value = "Authorization") String token) {
Integer userId = JwtUtil.getUserIdFromToken(token);
public ResponseModel<List<CollectionNftVo>> listCopyright() {
Integer userId = LoginUserInfo.getLoginUser().getUserId();
List<CollectionNftVo> list = nftService.listCopyright(userId);
return ResponseModel.success(list);
}
......
......@@ -7,13 +7,14 @@ import com.fzm.common.service.NftTransferRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -25,10 +26,10 @@ import java.util.List;
@Authentication
@RequestMapping(value = "/nft/transfer/record")
@Api(tags = "nft转让记录")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftTransferRecordController {
@Resource
private NftTransferRecordService nftTransferRecordService;
private final NftTransferRecordService nftTransferRecordService;
@GetMapping("/list/{type}")
@ApiOperation(value = "查询我的nft流转记录")
......
......@@ -5,11 +5,12 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.OpusCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
......@@ -19,10 +20,10 @@ import java.util.List;
@Api(tags = "作品类别")
@RestController
@RequestMapping("/opus/category")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OpusCategoryController {
@Resource
private OpusCategoryService opusCategoryService;
private final OpusCategoryService opusCategoryService;
@GetMapping("/list")
@ApiOperation(value = "查询作品类别列表")
......
......@@ -9,9 +9,10 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
......@@ -23,10 +24,10 @@ import java.util.List;
@Api(tags = "订单管理")
@RestController
@RequestMapping("/order")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrderController {
@Resource
private OrderService orderService;
private final OrderService orderService;
@PostMapping("/create")
......
......@@ -5,13 +5,14 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.utils.ObsUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
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.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
/**
......@@ -21,10 +22,10 @@ import java.io.IOException;
@RestController
@RequestMapping("/oss")
@Api(tags = "oss相关")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OssController {
@Resource
private ObsUtil obsUtil;
private final ObsUtil obsUtil;
@Authentication
......
......@@ -6,6 +6,7 @@ import com.fzm.common.constant.TokenConstant;
import com.fzm.common.entity.User;
import com.fzm.common.enums.ResultCode;
import com.fzm.common.exception.GlobalException;
import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.model.ResponseModel;
import com.fzm.common.params.LoginParam;
import com.fzm.common.service.UserService;
......@@ -16,12 +17,13 @@ import com.tencentcloudapi.faceid.v20180301.models.IdCardOCRVerificationResponse
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
......@@ -34,16 +36,12 @@ import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping(value = "/user")
@Api(tags = "用户管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class UserController {
@Resource
private UserService userService;
@Resource
private ObsUtil obsUtil;
@Resource
private RedisUtil redisUtil;
private final UserService userService;
private final ObsUtil obsUtil;
private final RedisUtil redisUtil;
@PostMapping(value = "/login")
@ApiOperation(value = "登录|注册")
......@@ -85,8 +83,8 @@ public class UserController {
@Authentication
@PostMapping(value = "/logout")
@ApiOperation(value = "退出登录")
public ResponseModel<Boolean> logout(@RequestHeader String Authorization) {
Integer userId = JwtUtil.getUserIdFromToken(Authorization);
public ResponseModel<Boolean> logout() {
Integer userId = LoginUserInfo.getLoginUser().getUserId();
redisUtil.delete(RedisConstant.PORTAL_USER_TOKEN_PREFIX + userId);
return ResponseModel.success();
}
......@@ -99,8 +97,8 @@ public class UserController {
@Authentication
@ApiOperation(value = "修改昵称 | 修改个性签名", notes = "用户修改哪项信息就传那一个参数就可以了")
@PostMapping("/update")
public ResponseModel<User> update(@Validated @RequestBody User user, @RequestHeader String Authorization) {
Integer userId = JwtUtil.getUserIdFromToken(Authorization);
public ResponseModel<User> update(@Validated @RequestBody User user) {
Integer userId = LoginUserInfo.getLoginUser().getUserId();
user.setId(userId);
userService.updateById(user);
return ResponseModel.success(userService.getById(userId));
......
......@@ -12,14 +12,14 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2021/6/23 15:56
......@@ -27,17 +27,12 @@ import javax.annotation.Resource;
@RestController
@RequestMapping(value = "/verificationCode")
@Api(tags = "验证码管理")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class VerificationCodeController {
@Resource
private UserService userService;
@Resource
private SmsProperties smsProperties;
@Resource
private SmsUtil smsUtil;
private final UserService userService;
private final SmsProperties smsProperties;
private final SmsUtil smsUtil;
@PostMapping(value = "/send/sms")
......@@ -67,6 +62,8 @@ public class VerificationCodeController {
switch (type) {
case 1:
return smsProperties.getLoginMessageCodetype();
case 2:
case 3:
default:
throw GlobalException.newException(ResultCode.CODE_ERROR);
}
......
......@@ -8,9 +8,10 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.WxPayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
......@@ -24,10 +25,10 @@ import java.util.Map;
@Api(tags = "微信支付")
@RestController
@RequestMapping("/wx-pay")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WxPayController {
@Resource
private WxPayService wxPayService;
private final WxPayService wxPayService;
@Authentication
@PostMapping("/pay/jsapi")
......
......@@ -7,13 +7,13 @@ import com.fzm.common.model.ResponseModel;
import com.fzm.common.service.NftService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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 javax.annotation.Resource;
/**
* @author tangtuo
* @date 2021/12/22 14:13
......@@ -21,10 +21,10 @@ import javax.annotation.Resource;
@RestController
@Api(tags = "对外服务")
@RequestMapping("/open/nft")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftApiController {
@Resource
private NftService nftService;
private final NftService nftService;
@GetMapping(value = "/hash")
@ApiOperation(value = "根据tokenId获取nft哈希")
......
......@@ -16,41 +16,29 @@ import com.fzm.common.service.OrderService;
import com.fzm.common.service.UserService;
import com.fzm.common.service.WxPayService;
import com.fzm.common.utils.RedisUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/1/21 16:49
*/
@Slf4j
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftListener {
@Resource
private ParaChainClient paraChainClient;
@Resource
private NftService nftService;
@Resource
UserService userService;
@Resource
private RedisUtil redisUtil;
@Resource
private OrderService orderService;
@Resource
private WxPayService wxPayService;
@Resource
private NotifyPublisher notifyPublisher;
private final ParaChainClient paraChainClient;
private final NftService nftService;
private final UserService userService;
private final RedisUtil redisUtil;
private final OrderService orderService;
private final WxPayService wxPayService;
private final NotifyPublisher notifyPublisher;
/**
* 监听nft发行结果
......
......@@ -9,28 +9,24 @@ import com.fzm.common.enums.RefundLaunchChannel;
import com.fzm.common.service.CopyrightApplyService;
import com.fzm.common.service.NftService;
import com.fzm.common.service.WxPayService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/1/21 11:44
*/
@Slf4j
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrderListener {
@Resource
private NftService nftService;
@Resource
private CopyrightApplyService copyrightApplyService;
@Resource
private WxPayService wxPayService;
private final NftService nftService;
private final CopyrightApplyService copyrightApplyService;
private final WxPayService wxPayService;
@RabbitListener(queues = "order.process.queue")
public void listenProcessOrder(OrderProcessMsg msg) throws Exception {
......
......@@ -2,13 +2,14 @@ package com.fzm.portal.schedule;
import com.fzm.common.entity.Draft;
import com.fzm.common.service.DraftService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.TimeUnit;
......@@ -18,13 +19,11 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class DraftTask {
@Resource
private DraftService draftService;
@Resource
private Redisson redisson;
private final DraftService draftService;
private final Redisson redisson;
/**
* 删除创建时间大于7天的草稿
......
......@@ -5,16 +5,16 @@ import com.fzm.common.entity.Order;
import com.fzm.common.enums.OrderStatus;
import com.fzm.common.enums.WxPayStatus;
import com.fzm.common.service.OrderService;
import com.fzm.common.service.RefundService;
import com.fzm.common.service.WxPayService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
import java.util.concurrent.TimeUnit;
......@@ -24,19 +24,12 @@ import java.util.concurrent.TimeUnit;
*/
@Slf4j
@Component
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PayTask {
@Resource
private OrderService orderService;
@Resource
private WxPayService wxPayService;
@Resource
private Redisson redisson;
@Resource
private RefundService refundService;
private final OrderService orderService;
private final WxPayService wxPayService;
private final Redisson redisson;
/**
* 定时关单的任务
......
......@@ -7,42 +7,36 @@ import com.fzm.common.properties.CopyrightProperties;
import com.fzm.common.service.CopyrightApplyService;
import com.fzm.common.service.OpusCategoryService;
import com.fzm.common.utils.RedisUtil;
import lombok.RequiredArgsConstructor;
import org.junit.jupiter.api.Test;
import org.redisson.api.RSemaphore;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.security.crypto.password.PasswordEncoder;
import javax.annotation.Resource;
import java.util.concurrent.ExecutionException;
@SpringBootTest
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
class LyPortalApplicationTests {
@Resource
private RedisUtil redisUtil;
private final RedisUtil redisUtil;
@Resource
private PasswordEncoder passwordEncoder;
private final PasswordEncoder passwordEncoder;
@Resource
StringRedisTemplate stringRedisTemplate;
private final StringRedisTemplate stringRedisTemplate;
@Resource
ParaChainClient paraClient;
private final ParaChainClient paraClient;
@Resource
RedissonClient redisson;
private final RedissonClient redisson;
@Resource
private CopyrightApplyService copyrightApplyService;
private final CopyrightApplyService copyrightApplyService;
@Resource
private OpusCategoryService opusCategoryService;
private final OpusCategoryService opusCategoryService;
@Resource
private CopyrightProperties copyrightProperties;
private final CopyrightProperties copyrightProperties;
@Test
void test1() throws ExecutionException, InterruptedException {
......
......@@ -11,20 +11,20 @@ import cn.fzm.chain.simplesdk.constant.EvmTokenEnum;
*/
public class NftEvm {
private static String rpcUrl = "http://119.8.39.159:8901";
private static String withhold = "";
private static String withholdKey = "a4c49dcb35e0032dc8db5891dc81481943b68fc558ce93ce74d0382c1d104934";
private static String tokenManager = "1KEBcdmMPfUV2suAqgkyDpdm4brZbYmdfF";
private static String tokenManagerKey = "0x5d872407fb2769854dcca6203d70696feced7099c588a6d9146a122025585e41";
private static String title = "user.p.FILMCHAIN.";
private static String cName = "user.evm.0xb3ae98ac253679602d54d1513aa9cad7d1b10d5f5117d5ce999c1bf67906ba99";
private static String cAddr = "1Nhju8CgSUmkQQwc7ECk4bFxnv48iRLNRX";
private static RpcApi ra = new RpcApi(rpcUrl, withhold, withholdKey, title);
private static String code = "60806040523480156200001157600080fd5b506040805160208101909152600081526200002c8162000033565b506200012f565b8051620000489060029060208401906200004c565b5050565b8280546200005a90620000f2565b90600052602060002090601f0160209004810192826200007e5760008555620000c9565b82601f106200009957805160ff1916838001178555620000c9565b82800160010185558215620000c9579182015b82811115620000c9578251825591602001919060010190620000ac565b50620000d7929150620000db565b5090565b5b80821115620000d75760008155600101620000dc565b600181811c908216806200010757607f821691505b602082108114156200012957634e487b7160e01b600052602260045260246000fd5b50919050565b61203a806200013f6000396000f3fe608060405234801561001057600080fd5b50600436106100ff5760003560e01c80638c7a63ae11610097578063e985e9c511610066578063e985e9c514610227578063ed8c593814610263578063f240ec3614610276578063f242432a1461028957600080fd5b80638c7a63ae146101db578063a08fad67146101ee578063a22cb46514610201578063aba7e0fd1461021457600080fd5b806323a36d2b116100d357806323a36d2b146101825780632eb2c2d6146101955780634e1273f4146101a8578063519dc8d2146101c857600080fd5b8062fdd58e1461010457806301ffc9a71461012a578063036ebef91461014d5780630e89341c14610162575b600080fd5b610117610112366004611553565b61029c565b6040519081526020015b60405180910390f35b61013d610138366004611596565b610336565b6040519015158152602001610121565b61016061015b3660046115ba565b610386565b005b6101756101703660046115fc565b6103e3565b6040516101219190611662565b610160610190366004611675565b610477565b6101606101a33660046117f4565b6104d2565b6101bb6101b636600461189e565b610569565b60405161012191906119a4565b6101bb6101d63660046119b7565b610693565b6101756101e93660046115fc565b6106fe565b6101606101fc366004611a1e565b61071b565b61016061020f366004611a9f565b610830565b610160610222366004611adb565b61083f565b61013d610235366004611b57565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610160610271366004611675565b610858565b610160610284366004611a1e565b610863565b610160610297366004611b8a565b6108d1565b60006001600160a01b03831661030d5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061036757506001600160e01b031982166303a24d0760e21b145b8061033057506301ffc9a760e01b6001600160e01b0319831614610330565b6103a284848484604051806020016040528060008152506108d1565b6103ac8383610958565b156103dd576001600160a01b0383166000908152600460209081526040822080546001810182559083529120018290555b50505050565b6060600280546103f290611bef565b80601f016020809104026020016040519081016040528092919081815260200182805461041e90611bef565b801561046b5780601f106104405761010080835404028352916020019161046b565b820191906000526020600020905b81548152906001019060200180831161044e57829003601f168201915b50505050509050919050565b61049283838360405180602001604052806000815250610a11565b61049c8383610958565b156104cd576001600160a01b0383166000908152600460209081526040822080546001810182559083529120018290555b505050565b6001600160a01b0385163314806104ee57506104ee8533610235565b6105555760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610304565b6105628585858585610ae1565b5050505050565b606081518351146105ce5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610304565b6000835167ffffffffffffffff8111156105ea576105ea6116a8565b604051908082528060200260200182016040528015610613578160200160208202803683370190505b50905060005b845181101561068b5761065e85828151811061063757610637611c2a565b602002602001015185838151811061065157610651611c2a565b602002602001015161029c565b82828151811061067057610670611c2a565b602090810291909101015261068481611c56565b9050610619565b509392505050565b6001600160a01b03811660009081526004602090815260409182902080548351818402810184019094528084526060939283018282801561046b57602002820191906000526020600020905b8154815260200190600101908083116106df5750505050509050919050565b60008181526003602052604090208054606091906103f290611bef565b6107978585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092018290525060408051602081019091529081529250610c75915050565b60005b83811015610828576107c4868686848181106107b8576107b8611c2a565b90506020020135610958565b15610816576001600160a01b03861660009081526004602052604090208585838181106107f3576107f3611c2a565b835460018101855560009485526020948590209190940292909201359190920155505b8061082081611c56565b91505061079a565b505050505050565b61083b338383610dc0565b5050565b60008381526003602052604090206103dd90838361149e565b6104cd838383610ea1565b6105628585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610fa392505050565b6001600160a01b0385163314806108ed57506108ed8533610235565b61094b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610304565b610562858585858561111f565b6001600160a01b0382166000908152600460209081526040808320805482518185028101850190935280835284938301828280156109b557602002820191906000526020600020905b8154815260200190600101908083116109a1575b5050505050905060005b8151811015610a0657838282815181106109db576109db611c2a565b602002602001015114156109f457600092505050610330565b806109fe81611c56565b9150506109bf565b506001949350505050565b6001600160a01b038416610a375760405162461bcd60e51b815260040161030490611c71565b33610a5181600087610a488861123c565b6105628861123c565b6000848152602081815260408083206001600160a01b038916845290915281208054859290610a81908490611cb2565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461056281600087878787611287565b8151835114610b025760405162461bcd60e51b815260040161030490611cca565b6001600160a01b038416610b285760405162461bcd60e51b815260040161030490611d12565b3360005b8451811015610c0f576000858281518110610b4957610b49611c2a565b602002602001015190506000858381518110610b6757610b67611c2a565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015610bb75760405162461bcd60e51b815260040161030490611d57565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610bf4908490611cb2565b9250508190555050505080610c0890611c56565b9050610b2c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610c5f929190611da1565b60405180910390a46108288187878787876113e3565b6001600160a01b038416610c9b5760405162461bcd60e51b815260040161030490611c71565b8151835114610cbc5760405162461bcd60e51b815260040161030490611cca565b3360005b8451811015610d5857838181518110610cdb57610cdb611c2a565b6020026020010151600080878481518110610cf857610cf8611c2a565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610d409190611cb2565b90915550819050610d5081611c56565b915050610cc0565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610da9929190611da1565b60405180910390a4610562816000878787876113e3565b816001600160a01b0316836001600160a01b03161415610e345760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610304565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038316610ec75760405162461bcd60e51b815260040161030490611dcf565b33610ef781856000610ed88761123c565b610ee18761123c565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b038816845290915290205482811015610f385760405162461bcd60e51b815260040161030490611e12565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6001600160a01b038316610fc95760405162461bcd60e51b815260040161030490611dcf565b8051825114610fea5760405162461bcd60e51b815260040161030490611cca565b604080516020810190915260009081905233905b83518110156110c057600084828151811061101b5761101b611c2a565b60200260200101519050600084838151811061103957611039611c2a565b602090810291909101810151600084815280835260408082206001600160a01b038c1683529093529190912054909150818110156110895760405162461bcd60e51b815260040161030490611e12565b6000928352602083815260408085206001600160a01b038b16865290915290922091039055806110b881611c56565b915050610ffe565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611111929190611da1565b60405180910390a450505050565b6001600160a01b0384166111455760405162461bcd60e51b815260040161030490611d12565b33611155818787610a488861123c565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156111965760405162461bcd60e51b815260040161030490611d57565b6000858152602081815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906111d3908490611cb2565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611233828888888888611287565b50505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061127657611276611c2a565b602090810291909101015292915050565b6001600160a01b0384163b156108285760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906112cb9089908990889088908890600401611e56565b6020604051808303816000875af1925050508015611306575060408051601f3d908101601f1916820190925261130391810190611e9b565b60015b6113b357611312611eb8565b806308c379a0141561134c5750611327611ed4565b80611332575061134e565b8060405162461bcd60e51b81526004016103049190611662565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610304565b6001600160e01b0319811663f23a6e6160e01b146112335760405162461bcd60e51b815260040161030490611f5e565b6001600160a01b0384163b156108285760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906114279089908990889088908890600401611fa6565b6020604051808303816000875af1925050508015611462575060408051601f3d908101601f1916820190925261145f91810190611e9b565b60015b61146e57611312611eb8565b6001600160e01b0319811663bc197c8160e01b146112335760405162461bcd60e51b815260040161030490611f5e565b8280546114aa90611bef565b90600052602060002090601f0160209004810192826114cc5760008555611512565b82601f106114e55782800160ff19823516178555611512565b82800160010185558215611512579182015b828111156115125782358255916020019190600101906114f7565b5061151e929150611522565b5090565b5b8082111561151e5760008155600101611523565b80356001600160a01b038116811461154e57600080fd5b919050565b6000806040838503121561156657600080fd5b61156f83611537565b946020939093013593505050565b6001600160e01b03198116811461159357600080fd5b50565b6000602082840312156115a857600080fd5b81356115b38161157d565b9392505050565b600080600080608085870312156115d057600080fd5b6115d985611537565b93506115e760208601611537565b93969395505050506040820135916060013590565b60006020828403121561160e57600080fd5b5035919050565b6000815180845260005b8181101561163b5760208185018101518683018201520161161f565b8181111561164d576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006115b36020830184611615565b60008060006060848603121561168a57600080fd5b61169384611537565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156116e4576116e46116a8565b6040525050565b600067ffffffffffffffff821115611705576117056116a8565b5060051b60200190565b600082601f83011261172057600080fd5b8135602061172d826116eb565b60405161173a82826116be565b83815260059390931b850182019282810191508684111561175a57600080fd5b8286015b84811015611775578035835291830191830161175e565b509695505050505050565b600082601f83011261179157600080fd5b813567ffffffffffffffff8111156117ab576117ab6116a8565b6040516117c2601f8301601f1916602001826116be565b8181528460208386010111156117d757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561180c57600080fd5b61181586611537565b945061182360208701611537565b9350604086013567ffffffffffffffff8082111561184057600080fd5b61184c89838a0161170f565b9450606088013591508082111561186257600080fd5b61186e89838a0161170f565b9350608088013591508082111561188457600080fd5b5061189188828901611780565b9150509295509295909350565b600080604083850312156118b157600080fd5b823567ffffffffffffffff808211156118c957600080fd5b818501915085601f8301126118dd57600080fd5b813560206118ea826116eb565b6040516118f782826116be565b83815260059390931b850182019282810191508984111561191757600080fd5b948201945b8386101561193c5761192d86611537565b8252948201949082019061191c565b9650508601359250508082111561195257600080fd5b5061195f8582860161170f565b9150509250929050565b600081518084526020808501945080840160005b838110156119995781518752958201959082019060010161197d565b509495945050505050565b6020815260006115b36020830184611969565b6000602082840312156119c957600080fd5b6115b382611537565b60008083601f8401126119e457600080fd5b50813567ffffffffffffffff8111156119fc57600080fd5b6020830191508360208260051b8501011115611a1757600080fd5b9250929050565b600080600080600060608688031215611a3657600080fd5b611a3f86611537565b9450602086013567ffffffffffffffff80821115611a5c57600080fd5b611a6889838a016119d2565b90965094506040880135915080821115611a8157600080fd5b50611a8e888289016119d2565b969995985093965092949392505050565b60008060408385031215611ab257600080fd5b611abb83611537565b915060208301358015158114611ad057600080fd5b809150509250929050565b600080600060408486031215611af057600080fd5b83359250602084013567ffffffffffffffff80821115611b0f57600080fd5b818601915086601f830112611b2357600080fd5b813581811115611b3257600080fd5b876020828501011115611b4457600080fd5b6020830194508093505050509250925092565b60008060408385031215611b6a57600080fd5b611b7383611537565b9150611b8160208401611537565b90509250929050565b600080600080600060a08688031215611ba257600080fd5b611bab86611537565b9450611bb960208701611537565b93506040860135925060608601359150608086013567ffffffffffffffff811115611be357600080fd5b61189188828901611780565b600181811c90821680611c0357607f821691505b60208210811415611c2457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c6a57611c6a611c40565b5060010190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60008219821115611cc557611cc5611c40565b500190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000611db46040830185611969565b8281036020840152611dc68185611969565b95945050505050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611e9090830184611615565b979650505050505050565b600060208284031215611ead57600080fd5b81516115b38161157d565b600060033d1115611ed15760046000803e5060005160e01c5b90565b600060443d1015611ee25790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1257505050505090565b8285019150815181811115611f2a5750505050505090565b843d8701016020828501011115611f445750505050505090565b611f53602082860101876116be565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a060408201819052600090611fd290830186611969565b8281036060840152611fe48186611969565b90508281036080840152611ff88185611615565b9897505050505050505056fea2646970667358221220df77f45404bbc21d49cd14e361e1a97dba87e98ae5c61aa4f7c14cad9666448d64736f6c634300080a0033";
private static final String rpcUrl = "http://119.8.39.159:8901";
private static final String withhold = "";
private static final String withholdKey = "a4c49dcb35e0032dc8db5891dc81481943b68fc558ce93ce74d0382c1d104934";
private static final String tokenManager = "1KEBcdmMPfUV2suAqgkyDpdm4brZbYmdfF";
private static final String tokenManagerKey = "0x5d872407fb2769854dcca6203d70696feced7099c588a6d9146a122025585e41";
private static final String title = "user.p.FILMCHAIN.";
private static final String cName = "user.evm.0xb3ae98ac253679602d54d1513aa9cad7d1b10d5f5117d5ce999c1bf67906ba99";
private static final String cAddr = "1Nhju8CgSUmkQQwc7ECk4bFxnv48iRLNRX";
private static final RpcApi ra = new RpcApi(rpcUrl, withhold, withholdKey, title);
private static final String code = "60806040523480156200001157600080fd5b506040805160208101909152600081526200002c8162000033565b506200012f565b8051620000489060029060208401906200004c565b5050565b8280546200005a90620000f2565b90600052602060002090601f0160209004810192826200007e5760008555620000c9565b82601f106200009957805160ff1916838001178555620000c9565b82800160010185558215620000c9579182015b82811115620000c9578251825591602001919060010190620000ac565b50620000d7929150620000db565b5090565b5b80821115620000d75760008155600101620000dc565b600181811c908216806200010757607f821691505b602082108114156200012957634e487b7160e01b600052602260045260246000fd5b50919050565b61203a806200013f6000396000f3fe608060405234801561001057600080fd5b50600436106100ff5760003560e01c80638c7a63ae11610097578063e985e9c511610066578063e985e9c514610227578063ed8c593814610263578063f240ec3614610276578063f242432a1461028957600080fd5b80638c7a63ae146101db578063a08fad67146101ee578063a22cb46514610201578063aba7e0fd1461021457600080fd5b806323a36d2b116100d357806323a36d2b146101825780632eb2c2d6146101955780634e1273f4146101a8578063519dc8d2146101c857600080fd5b8062fdd58e1461010457806301ffc9a71461012a578063036ebef91461014d5780630e89341c14610162575b600080fd5b610117610112366004611553565b61029c565b6040519081526020015b60405180910390f35b61013d610138366004611596565b610336565b6040519015158152602001610121565b61016061015b3660046115ba565b610386565b005b6101756101703660046115fc565b6103e3565b6040516101219190611662565b610160610190366004611675565b610477565b6101606101a33660046117f4565b6104d2565b6101bb6101b636600461189e565b610569565b60405161012191906119a4565b6101bb6101d63660046119b7565b610693565b6101756101e93660046115fc565b6106fe565b6101606101fc366004611a1e565b61071b565b61016061020f366004611a9f565b610830565b610160610222366004611adb565b61083f565b61013d610235366004611b57565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610160610271366004611675565b610858565b610160610284366004611a1e565b610863565b610160610297366004611b8a565b6108d1565b60006001600160a01b03831661030d5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000818152602081815260408083206001600160a01b03861684529091529020545b92915050565b60006001600160e01b03198216636cdb3d1360e11b148061036757506001600160e01b031982166303a24d0760e21b145b8061033057506301ffc9a760e01b6001600160e01b0319831614610330565b6103a284848484604051806020016040528060008152506108d1565b6103ac8383610958565b156103dd576001600160a01b0383166000908152600460209081526040822080546001810182559083529120018290555b50505050565b6060600280546103f290611bef565b80601f016020809104026020016040519081016040528092919081815260200182805461041e90611bef565b801561046b5780601f106104405761010080835404028352916020019161046b565b820191906000526020600020905b81548152906001019060200180831161044e57829003601f168201915b50505050509050919050565b61049283838360405180602001604052806000815250610a11565b61049c8383610958565b156104cd576001600160a01b0383166000908152600460209081526040822080546001810182559083529120018290555b505050565b6001600160a01b0385163314806104ee57506104ee8533610235565b6105555760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610304565b6105628585858585610ae1565b5050505050565b606081518351146105ce5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610304565b6000835167ffffffffffffffff8111156105ea576105ea6116a8565b604051908082528060200260200182016040528015610613578160200160208202803683370190505b50905060005b845181101561068b5761065e85828151811061063757610637611c2a565b602002602001015185838151811061065157610651611c2a565b602002602001015161029c565b82828151811061067057610670611c2a565b602090810291909101015261068481611c56565b9050610619565b509392505050565b6001600160a01b03811660009081526004602090815260409182902080548351818402810184019094528084526060939283018282801561046b57602002820191906000526020600020905b8154815260200190600101908083116106df5750505050509050919050565b60008181526003602052604090208054606091906103f290611bef565b6107978585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092018290525060408051602081019091529081529250610c75915050565b60005b83811015610828576107c4868686848181106107b8576107b8611c2a565b90506020020135610958565b15610816576001600160a01b03861660009081526004602052604090208585838181106107f3576107f3611c2a565b835460018101855560009485526020948590209190940292909201359190920155505b8061082081611c56565b91505061079a565b505050505050565b61083b338383610dc0565b5050565b60008381526003602052604090206103dd90838361149e565b6104cd838383610ea1565b6105628585858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808902828101820190935288825290935088925087918291850190849080828437600092019190915250610fa392505050565b6001600160a01b0385163314806108ed57506108ed8533610235565b61094b5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608401610304565b610562858585858561111f565b6001600160a01b0382166000908152600460209081526040808320805482518185028101850190935280835284938301828280156109b557602002820191906000526020600020905b8154815260200190600101908083116109a1575b5050505050905060005b8151811015610a0657838282815181106109db576109db611c2a565b602002602001015114156109f457600092505050610330565b806109fe81611c56565b9150506109bf565b506001949350505050565b6001600160a01b038416610a375760405162461bcd60e51b815260040161030490611c71565b33610a5181600087610a488861123c565b6105628861123c565b6000848152602081815260408083206001600160a01b038916845290915281208054859290610a81908490611cb2565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a461056281600087878787611287565b8151835114610b025760405162461bcd60e51b815260040161030490611cca565b6001600160a01b038416610b285760405162461bcd60e51b815260040161030490611d12565b3360005b8451811015610c0f576000858281518110610b4957610b49611c2a565b602002602001015190506000858381518110610b6757610b67611c2a565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015610bb75760405162461bcd60e51b815260040161030490611d57565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610bf4908490611cb2565b9250508190555050505080610c0890611c56565b9050610b2c565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610c5f929190611da1565b60405180910390a46108288187878787876113e3565b6001600160a01b038416610c9b5760405162461bcd60e51b815260040161030490611c71565b8151835114610cbc5760405162461bcd60e51b815260040161030490611cca565b3360005b8451811015610d5857838181518110610cdb57610cdb611c2a565b6020026020010151600080878481518110610cf857610cf8611c2a565b602002602001015181526020019081526020016000206000886001600160a01b03166001600160a01b031681526020019081526020016000206000828254610d409190611cb2565b90915550819050610d5081611c56565b915050610cc0565b50846001600160a01b031660006001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610da9929190611da1565b60405180910390a4610562816000878787876113e3565b816001600160a01b0316836001600160a01b03161415610e345760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610304565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b038316610ec75760405162461bcd60e51b815260040161030490611dcf565b33610ef781856000610ed88761123c565b610ee18761123c565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b038816845290915290205482811015610f385760405162461bcd60e51b815260040161030490611e12565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b6001600160a01b038316610fc95760405162461bcd60e51b815260040161030490611dcf565b8051825114610fea5760405162461bcd60e51b815260040161030490611cca565b604080516020810190915260009081905233905b83518110156110c057600084828151811061101b5761101b611c2a565b60200260200101519050600084838151811061103957611039611c2a565b602090810291909101810151600084815280835260408082206001600160a01b038c1683529093529190912054909150818110156110895760405162461bcd60e51b815260040161030490611e12565b6000928352602083815260408085206001600160a01b038b16865290915290922091039055806110b881611c56565b915050610ffe565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611111929190611da1565b60405180910390a450505050565b6001600160a01b0384166111455760405162461bcd60e51b815260040161030490611d12565b33611155818787610a488861123c565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156111965760405162461bcd60e51b815260040161030490611d57565b6000858152602081815260408083206001600160a01b038b81168552925280832087850390559088168252812080548692906111d3908490611cb2565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611233828888888888611287565b50505050505050565b6040805160018082528183019092526060916000919060208083019080368337019050509050828160008151811061127657611276611c2a565b602090810291909101015292915050565b6001600160a01b0384163b156108285760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906112cb9089908990889088908890600401611e56565b6020604051808303816000875af1925050508015611306575060408051601f3d908101601f1916820190925261130391810190611e9b565b60015b6113b357611312611eb8565b806308c379a0141561134c5750611327611ed4565b80611332575061134e565b8060405162461bcd60e51b81526004016103049190611662565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610304565b6001600160e01b0319811663f23a6e6160e01b146112335760405162461bcd60e51b815260040161030490611f5e565b6001600160a01b0384163b156108285760405163bc197c8160e01b81526001600160a01b0385169063bc197c81906114279089908990889088908890600401611fa6565b6020604051808303816000875af1925050508015611462575060408051601f3d908101601f1916820190925261145f91810190611e9b565b60015b61146e57611312611eb8565b6001600160e01b0319811663bc197c8160e01b146112335760405162461bcd60e51b815260040161030490611f5e565b8280546114aa90611bef565b90600052602060002090601f0160209004810192826114cc5760008555611512565b82601f106114e55782800160ff19823516178555611512565b82800160010185558215611512579182015b828111156115125782358255916020019190600101906114f7565b5061151e929150611522565b5090565b5b8082111561151e5760008155600101611523565b80356001600160a01b038116811461154e57600080fd5b919050565b6000806040838503121561156657600080fd5b61156f83611537565b946020939093013593505050565b6001600160e01b03198116811461159357600080fd5b50565b6000602082840312156115a857600080fd5b81356115b38161157d565b9392505050565b600080600080608085870312156115d057600080fd5b6115d985611537565b93506115e760208601611537565b93969395505050506040820135916060013590565b60006020828403121561160e57600080fd5b5035919050565b6000815180845260005b8181101561163b5760208185018101518683018201520161161f565b8181111561164d576000602083870101525b50601f01601f19169290920160200192915050565b6020815260006115b36020830184611615565b60008060006060848603121561168a57600080fd5b61169384611537565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff811182821017156116e4576116e46116a8565b6040525050565b600067ffffffffffffffff821115611705576117056116a8565b5060051b60200190565b600082601f83011261172057600080fd5b8135602061172d826116eb565b60405161173a82826116be565b83815260059390931b850182019282810191508684111561175a57600080fd5b8286015b84811015611775578035835291830191830161175e565b509695505050505050565b600082601f83011261179157600080fd5b813567ffffffffffffffff8111156117ab576117ab6116a8565b6040516117c2601f8301601f1916602001826116be565b8181528460208386010111156117d757600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a0868803121561180c57600080fd5b61181586611537565b945061182360208701611537565b9350604086013567ffffffffffffffff8082111561184057600080fd5b61184c89838a0161170f565b9450606088013591508082111561186257600080fd5b61186e89838a0161170f565b9350608088013591508082111561188457600080fd5b5061189188828901611780565b9150509295509295909350565b600080604083850312156118b157600080fd5b823567ffffffffffffffff808211156118c957600080fd5b818501915085601f8301126118dd57600080fd5b813560206118ea826116eb565b6040516118f782826116be565b83815260059390931b850182019282810191508984111561191757600080fd5b948201945b8386101561193c5761192d86611537565b8252948201949082019061191c565b9650508601359250508082111561195257600080fd5b5061195f8582860161170f565b9150509250929050565b600081518084526020808501945080840160005b838110156119995781518752958201959082019060010161197d565b509495945050505050565b6020815260006115b36020830184611969565b6000602082840312156119c957600080fd5b6115b382611537565b60008083601f8401126119e457600080fd5b50813567ffffffffffffffff8111156119fc57600080fd5b6020830191508360208260051b8501011115611a1757600080fd5b9250929050565b600080600080600060608688031215611a3657600080fd5b611a3f86611537565b9450602086013567ffffffffffffffff80821115611a5c57600080fd5b611a6889838a016119d2565b90965094506040880135915080821115611a8157600080fd5b50611a8e888289016119d2565b969995985093965092949392505050565b60008060408385031215611ab257600080fd5b611abb83611537565b915060208301358015158114611ad057600080fd5b809150509250929050565b600080600060408486031215611af057600080fd5b83359250602084013567ffffffffffffffff80821115611b0f57600080fd5b818601915086601f830112611b2357600080fd5b813581811115611b3257600080fd5b876020828501011115611b4457600080fd5b6020830194508093505050509250925092565b60008060408385031215611b6a57600080fd5b611b7383611537565b9150611b8160208401611537565b90509250929050565b600080600080600060a08688031215611ba257600080fd5b611bab86611537565b9450611bb960208701611537565b93506040860135925060608601359150608086013567ffffffffffffffff811115611be357600080fd5b61189188828901611780565b600181811c90821680611c0357607f821691505b60208210811415611c2457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c6a57611c6a611c40565b5060010190565b60208082526021908201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60008219821115611cc557611cc5611c40565b500190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b604081526000611db46040830185611969565b8281036020840152611dc68185611969565b95945050505050565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090611e9090830184611615565b979650505050505050565b600060208284031215611ead57600080fd5b81516115b38161157d565b600060033d1115611ed15760046000803e5060005160e01c5b90565b600060443d1015611ee25790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1257505050505090565b8285019150815181811115611f2a5750505050505090565b843d8701016020828501011115611f445750505050505090565b611f53602082860101876116be565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a060408201819052600090611fd290830186611969565b8281036060840152611fe48186611969565b90508281036080840152611ff88185611615565b9897505050505050505056fea2646970667358221220df77f45404bbc21d49cd14e361e1a97dba87e98ae5c61aa4f7c14cad9666448d64736f6c634300080a0033";
//private static String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getUserTokens\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
static String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
private static final String abi = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"burnTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"getTokenInfo\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mintToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"tokenIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"}],\"name\":\"mintTokenBatch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tokenInfo\",\"type\":\"string\"}],\"name\":\"setTokenInfo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]";
public static void main(String[] args) throws Exception {
long l = ra.evmBalance(abi, cAddr, EvmTokenEnum.ERC1155, "182mR7y2EEnHG9cDpc6ik8xRtkamzeHMHr", 1641296392);
......
package com.fzm.portal;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2021/12/23 14:41
*/
@Slf4j
@SpringBootTest
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class RabbitTestDemo {
@Resource
private RabbitTemplate rabbitTemplate;
private final RabbitTemplate rabbitTemplate;
@Test
public void send() {
......
package com.fzm.portal;
import com.fzm.common.utils.SnowflakeUtil;
import lombok.RequiredArgsConstructor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
/**
* @author tangtuo
* @date 2022/1/19 14:04
*/
@SpringBootTest
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class SnawFlakeTest {
@Resource
private SnowflakeUtil snowflakeUtil;
private final SnowflakeUtil snowflakeUtil;
@Test
public void test1() {
......
......@@ -17,11 +17,10 @@ public class Test {
private static final String USER_AGENT = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50";
private static final int TIME_OUT = 60 * 1000;
private static RequestConfig requestConfig;
private static CloseableHttpClient httpClient;
private static final CloseableHttpClient httpClient;
static {
requestConfig = RequestConfig.custom()
RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(TIME_OUT)
.setSocketTimeout(TIME_OUT)
.setConnectionRequestTimeout(TIME_OUT)
......
......@@ -5,14 +5,15 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fzm.common.properties.WxPayProperties;
import com.fzm.common.service.WxPayService;
import com.fzm.common.utils.SnowflakeUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
......@@ -22,23 +23,19 @@ import java.io.IOException;
*/
@Slf4j
@SpringBootTest
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WxPayTest {
@Resource
private CloseableHttpClient httpClient;
private final CloseableHttpClient httpClient;
@Resource
private WxPayProperties wxPayProperties;
private final WxPayProperties wxPayProperties;
@Resource
private WxPayService wxPayService;
private final WxPayService wxPayService;
@Resource
private SnowflakeUtil snowflakeUtil;
private final SnowflakeUtil snowflakeUtil;
@Resource
private RabbitTemplate rabbitTemplate;
private final RabbitTemplate rabbitTemplate;
@Test
public void testSnowFlake() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment