You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.5 KiB
46 lines
1.5 KiB
package com.fr.plugin.web.hander; |
|
|
|
import com.fr.decision.fun.impl.BaseHttpHandler; |
|
import com.fr.json.JSONObject; |
|
import com.fr.plugin.yt.MyCoreDBAccess; |
|
import com.fr.plugin.dao.MyAgentDao; |
|
import com.fr.plugin.entitys.YTAgentEntity; |
|
import com.fr.plugin.utils.MyUtils; |
|
import com.fr.stable.db.action.DBAction; |
|
import com.fr.stable.db.dao.DAOContext; |
|
import com.fr.third.springframework.web.bind.annotation.RequestMethod; |
|
import com.fr.web.utils.WebUtils; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
import javax.servlet.http.HttpServletResponse; |
|
import java.util.List; |
|
|
|
public class DelAgentHander extends BaseHttpHandler { |
|
@Override |
|
public RequestMethod getMethod() { |
|
return RequestMethod.DELETE; |
|
} |
|
|
|
@Override |
|
public String getPath() { |
|
return "/yt/agent"; |
|
} |
|
|
|
@Override |
|
public boolean isPublic() { |
|
return false; |
|
} |
|
|
|
@Override |
|
public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { |
|
final String var3 = WebUtils.getHTTPRequestParameter(httpServletRequest, "id"); |
|
MyCoreDBAccess.getAccessor().runDMLAction(new DBAction<List<YTAgentEntity>>() { |
|
public List<YTAgentEntity> run(DAOContext var1) throws Exception { |
|
var1.getDAO(MyAgentDao.class).remove(var3); |
|
return null; |
|
} |
|
}); |
|
JSONObject var4 = MyUtils.createSuccessResponseJSONObject(); |
|
WebUtils.flushSuccessMessageAutoClose(httpServletRequest, httpServletResponse, var4); |
|
} |
|
}
|
|
|