1.21

今天实现实体类

Result.java

package com.example.pojo;

/**
 * 统一响应结果封装类
 */
public class Result {
    private Integer code;//1 成功 , 0 失败
    private String msg; //提示信息
    private Object data; //数据 data


    public static Result success(Object data) {
        return new Result(1, "success", data);
    }

    public static Result success() {
        return new Result(1, "success", null);
    }

    public static Result error(String msg) {
        return new Result(0, msg, null);
    }

    public Result() {
    }

    public Result(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}

Application.java

package com.example.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Application {
    private String id;
    private String name;
    private String department;
    private String destination;
    private LocalDateTime departureDate;
    private LocalDateTime returnDate;
    private String type;
    private String typeContent;
    private String reason;
    private String state;
    private String stateReason;
}

Baoxiao.java

package com.example.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Baoxiao {
    private String id;
    private String name;
    private String department;
    private String destination;
    private LocalDateTime departureDate;
    private LocalDateTime returnDate;
    private String reason;
    int StartFare;
    int ReturnFare;
    int foodAllowance;
    int localTrans;
    int Accommodation;
    int totalAmount;
    private String schedule;
    private String scheduleReason;

}

Staff.java

package com.example.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Staff {
    private String userID;
    private String userName;
    private String department;
    private String password;
    private String position;

}

 

posted @ 2024-01-26 18:10  七安。  阅读(22)  评论(0编辑  收藏  举报