All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.duoec.doc.constants.SpringMvcConstants Maven / Gradle / Ivy

package com.duoec.doc.constants;

import java.util.HashMap;
import java.util.Map;

/**
 * @author xuwenzhen
 */
public class SpringMvcConstants {
    public static final String ANNOTATION_REST_CONTROLLER = "org.springframework.web.bind.annotation.RestController";

    public static final String ANNOTATION_REQUEST_MAPPING = "org.springframework.web.bind.annotation.RequestMapping";
    public static final String ANNOTATION_GET_MAPPING = "org.springframework.web.bind.annotation.GetMapping";
    public static final String ANNOTATION_POST_MAPPING = "org.springframework.web.bind.annotation.PostMapping";
    public static final String ANNOTATION_PUT_MAPPING = "org.springframework.web.bind.annotation.PutMapping";
    public static final String ANNOTATION_PATCH_MAPPING = "org.springframework.web.bind.annotation.PatchMapping";
    public static final String ANNOTATION_DELETE_MAPPING = "org.springframework.web.bind.annotation.DeleteMapping";
    public static final String ANNOTATION_REQUEST_BODY = "@RequestBody";

    private static final String METHOD_GET = "GET";
    private static final String METHOD_POST = "POST";
    private static final String METHOD_PUT = "PUT";
    private static final String METHOD_PATCH = "PATCH";
    private static final String METHOD_DELETE = "DELETE";

    /**
     * RestFul接口方法定义
     */
    public static final Map METHOD_MAPPINGS = new HashMap<>();
    static {
        METHOD_MAPPINGS.put(SpringMvcConstants.ANNOTATION_REQUEST_MAPPING, DuoDocletConstants.EMPTY_STRING);
        METHOD_MAPPINGS.put(SpringMvcConstants.ANNOTATION_GET_MAPPING, METHOD_GET);
        METHOD_MAPPINGS.put(SpringMvcConstants.ANNOTATION_POST_MAPPING, METHOD_POST);
        METHOD_MAPPINGS.put(SpringMvcConstants.ANNOTATION_PUT_MAPPING, METHOD_PUT);
        METHOD_MAPPINGS.put(SpringMvcConstants.ANNOTATION_PATCH_MAPPING, METHOD_PATCH);
        METHOD_MAPPINGS.put(SpringMvcConstants.ANNOTATION_DELETE_MAPPING, METHOD_DELETE);
    }

    private SpringMvcConstants() {
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy