MObjectInfoCtrl.java 2.28 KB
package com.ui.ctrl;

import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.req.MObjectHostInfoReq;
import com.ui.model.req.MObjectInfoReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by yoho on 2016/6/16.
 */
@RestController
@RequestMapping(value = "/mobject")
public class MObjectInfoCtrl {

    @Autowired
    HttpRestClient httpRestClient;

    @RequestMapping("/toMobject")
    public ModelAndView toMobject() {
        return new  ModelAndView("mobject/mobjectInfo");
    }

    //前台提供currentpage,pagesize,isType,typeIds,hostIps
    @RequestMapping(value = "/query")
    public BaseResponse queryAllMObjectInfo(MObjectInfoReq request) {

        BaseResponse response = httpRestClient.defaultPost("/mobject/query", request, BaseResponse.class);

        return response;
    }


    //前台提供mo_id
    @RequestMapping(value = "/delete")
    public BaseResponse deleteMObjectInfo(MObjectInfoReq request) {

        BaseResponse response = httpRestClient.defaultPost("/mobject/delete", request, BaseResponse.class);

        return response;
    }

    //前台提供 mo_id,mo_name,mo_typeId,mo_hostIP,mo_tags,mo_url
    @RequestMapping(value = "/update")
    public BaseResponse updateMObjectInfo(MObjectInfoReq request) {

        BaseResponse response = httpRestClient.defaultPost("/mobject/update", request, BaseResponse.class);

        return response;
    }

    //前台提供 mo_name,mo_typeId,mo_hostIp,mo_tags,mo_url
    @RequestMapping(value = "/add")
    public BaseResponse addMObjectInfo(MObjectInfoReq request) {

        BaseResponse response = httpRestClient.defaultPost("/mobject/add", request, BaseResponse.class);

        return response;
    }

    @RequestMapping(value = "/queryHost")
    public BaseResponse queryMHostInfo(MObjectHostInfoReq request) {

        BaseResponse response = httpRestClient.defaultPost("/mobject/queryHost", request, BaseResponse.class);

        return response;
    }

    @RequestMapping(value = "/queryJavaApp")
    public BaseResponse queryMHostInfo() {

        BaseResponse response = httpRestClient.defaultGet("/mobject/javaapi", BaseResponse.class);
        return response;
    }

}