• shop--9.商品--辅助工具


    ProductStateEnum

    public enum ProductStateEnum {
        SUCCESS(1, "插入成功"), INNER_ERROR(-1001, "操作失败");
        
        private int state;
        private String stateInfo;
    
        ProductStateEnum(int state, String stateInfo) {
            this.state = state;
            this.stateInfo = stateInfo;
        }
        
        public int getState() {
            return state;
        }
    
        public String getStateInfo() {
            return stateInfo;
        }
    }
    

      

    ProductOperationException

    public class ProductOperationException extends RuntimeException {
        private static final long serialVersionUID = -6851228251862891341L;
    
        public ProductOperationException(String message) {
            super( message );
        }
    }
    

      

    ProductExecution

    public class ProductExecution {
        private int state;
        private String stateInfo;
        private int count;
        private Product product;
        private List<Product> productList;
    
        public ProductExecution(){
    
        }
        //操作失败的构造器
        public ProductExecution(ProductStateEnum productStateEnum) {
            this.state = productStateEnum.getState();
            this.stateInfo = productStateEnum.getStateInfo();
        }
    
    
        //操作成功的构造器1  单个商品
        public ProductExecution(ProductStateEnum productStateEnum, Product product){
            this.state = productStateEnum.getState();
            this.stateInfo = productStateEnum.getStateInfo();
            this.product = product;
        }
    
        //操作成功的构造器2  多个商品
        public ProductExecution(ProductStateEnum productStateEnum, List<Product> productList){
            this.state = productStateEnum.getState();
            this.stateInfo = productStateEnum.getStateInfo();
            this.productList = productList;
        }
    
    
        public int getState() {
            return state;
        }
    
        public void setState(int state) {
            this.state = state;
        }
    
        public String getStateInfo() {
            return stateInfo;
        }
    
        public void setStateInfo(String stateInfo) {
            this.stateInfo = stateInfo;
        }
    
        public int getCount() {
            return count;
        }
    
        public void setCount(int count) {
            this.count = count;
        }
    
        public Product getProduct() {
            return product;
        }
    
        public void setProduct(Product product) {
            this.product = product;
        }
    
        public List<Product> getProductList() {
            return productList;
        }
    
        public void setProductList(List<Product> productList) {
            this.productList = productList;
        }
    }
    

      

  • 相关阅读:
    Alpha项目冲刺_博客链接合集
    项目系统设计
    项目需求分析
    项目选题
    项目展示
    原型设计 + 用户规格说明书
    测试与优化
    结对作业1
    MathExam6317
    js入门基础
  • 原文地址:https://www.cnblogs.com/SkyeAngel/p/8991426.html
Copyright © 2020-2023  润新知