Newer
Older
JerseyExercise / src / main / java / com / example / jerseyexercise / resources / DaikunoGenSanRest.java
kazuki-danno on 17 Nov 2022 559 bytes To Tokiwa
package com.example.jerseyexercise.resources;

import org.springframework.stereotype.Component;
import javax.ws.rs.*;
import javax.ws.rs.core.*;

@Path("/DaikunoGenSan")
@Component
public class DaikunoGenSanRest {
    private String message = "Toraga-wo Hidari-ni Modoshite-kurei!!";

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

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