zoukankan      html  css  js  c++  java
  • 7月24 springboot 打包打小包 | mybatis 逆向工程 | 接口返回数据 | 启动打包注意事项 | springboot redis 引入

    一、springboot 打包打小包

        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <!-- <configuration>
                        <fork>true</fork>
                    </configuration> -->
                    
                    <configuration>
                        <fork>false</fork>
                     </configuration>
                </plugin>
            </plugins>
        </build>

    设置为true 就是打小包,false 原来的包

    二、mybatis 逆向工程使用

    CommentVoExample commentVoExample = new CommentVoExample();

    // 设置条件 commentVoExample.createCriteria().andCidEqualTo(cid)
    .andStatusEqualTo("approved");

    // 排序 commentVoExample.setOrderByClause(
    "coid desc");

    设置条件和 排序的使用

    三、接口返回

    package cn.com.connext.authority.utils;
    
    public class LYResultVO {
    
        private Object obj;
        /** 0 表示成功 1 是失败*/
        private int state;
        private String msg;
        
        public Object getObj() {
            return obj;
        }
        public void setObj(Object obj) {
            this.obj = obj;
        }
        public int getState() {
            return state;
        }
        public void setState(int state) {
            this.state = state;
        }
        public String getMsg() {
            return msg;
        }
        public void setMsg(String msg) {
            this.msg = msg;
        }
        public LYResultVO() {
            super();
            // TODO Auto-generated constructor stub
        }
        public LYResultVO(Object obj, int state, String msg) {
            super();
            this.obj = obj;
            this.state = state;
            this.msg = msg;
        }
        
        
        
        public LYResultVO(int state, String msg) {
            super();
            this.state = state;
            this.msg = msg;
        }
        public static LYResultVO errorResultVO(String msg){
            return new LYResultVO(1,msg);
        }
        
        public static LYResultVO successResultVO(Object obj,String msg){
            return new LYResultVO(obj,0,msg);
        }
    }

    四、启动打包注意事项

    启动打包,注意数据库配置,端口配置是否正确。尽量减少这样类型的错误。浪费时间

    五、 springboot redis 引入

    https://my.oschina.net/xiedeshou/blog/1861727

  • 相关阅读:
    九省联考2018 解题报告
    「PKUSC2018」最大前缀和(状压dp)
    「雅礼集训 2017 Day2」解题报告
    UVA10829 L-Gap Substrings(后缀数组+ST表)
    [BZOJ2738]矩阵乘法(整体二分+二维树状数组)
    「雅礼集训 2017 Day1」 解题报告
    LeetCode 190. Reverse Bits (算32次即可)
    LeetCode 437. Path Sum III (STL map前缀和)
    LeetCode 744. Find Smallest Letter Greater Than Target (时间复杂度O(n))
    LeetCode 1. Two Sum (c++ stl map)
  • 原文地址:https://www.cnblogs.com/lyon91/p/9358906.html
Copyright © 2011-2022 走看看