Newer
Older
JerseyExercise / src / main / java / com / example / jerseyexercise / resources / GoldenWeekRest.java
t-nagao on 17 Nov 2022 531 bytes レスト、マージ。
package com.example.jerseyexercise.resources;

import org.springframework.stereotype.Component;

import javax.ws.rs.*;
import javax.ws.rs.core.*;

@Path("/GoldenWeek")
@Component
public class GoldenWeekRest {
    private String words = "Golden Week is fuck.";

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getMessage() {
        return words;
    }

    @PUT
    @Produces(MediaType.TEXT_PLAIN)
    public String setMessage(@FormParam("message") String w) {
        words = w;
        return "Success!!";
    }
}