123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218 |
- package http
- import (
- "go-common/app/admin/ep/marthe/model"
- bm "go-common/library/net/http/blademaster"
- "go-common/library/net/http/blademaster/binding"
- )
- // bugly version
- func updateVersion(c *bm.Context) {
- var (
- req = &model.AddVersionRequest{}
- err error
- username string
- )
- if err = c.BindWith(req, binding.JSON); err != nil {
- return
- }
- if username, err = getUsername(c); err != nil {
- return
- }
- c.JSON(srv.UpdateBuglyVersion(c, username, req))
- }
- func getVersionAndProjectList(c *bm.Context) {
- c.JSON(srv.BuglyVersionAndProjectList(c))
- }
- func queryVersions(c *bm.Context) {
- var (
- req = &model.QueryBuglyVersionRequest{}
- err error
- )
- if err = req.Verify(); err != nil {
- c.JSON(nil, err)
- return
- }
- if err = c.BindWith(req, binding.JSON); err != nil {
- return
- }
- c.JSON(srv.QueryBuglyVersions(c, req))
- }
- func runVersions(c *bm.Context) {
- var (
- v = new(struct {
- ID int64 `form:"id"`
- })
- err error
- )
- if err = c.Bind(v); err != nil {
- return
- }
- c.JSON(srv.RunVersions(v.ID))
- }
- // bugly cookie
- func updateCookie(c *bm.Context) {
- var (
- req = &model.AddCookieRequest{}
- err error
- username string
- )
- if username, err = getUsername(c); err != nil {
- return
- }
- if err = c.BindWith(req, binding.JSON); err != nil {
- return
- }
- c.JSON(srv.UpdateCookie(c, username, req))
- }
- func queryCookies(c *bm.Context) {
- var (
- req = &model.QueryBuglyCookiesRequest{}
- err error
- )
- if err = req.Verify(); err != nil {
- c.JSON(nil, err)
- return
- }
- if err = c.BindWith(req, binding.JSON); err != nil {
- return
- }
- c.JSON(srv.QueryCookies(c, req))
- }
- func updateCookieStatus(c *bm.Context) {
- var (
- v = new(struct {
- ID int64 `form:"id"`
- Status int `form:"status"`
- })
- err error
- )
- if err = c.Bind(v); err != nil {
- return
- }
- c.JSON(nil, srv.UpdateCookieStatus(c, v.ID, v.Status))
- }
- // bugly issue
- func queryBuglyIssue(c *bm.Context) {
- var (
- err error
- v = &model.QueryBuglyIssueRequest{}
- )
- if err = c.BindWith(v, binding.JSON); err != nil {
- return
- }
- c.JSON(srv.QueryBuglyIssueRecords(c, v))
- }
- func queryBatchRun(c *bm.Context) {
- var (
- err error
- v = &model.QueryBuglyBatchRunsRequest{}
- )
- if err = c.BindWith(v, binding.JSON); err != nil {
- return
- }
- c.JSON(srv.QueryBatchRuns(c, v))
- }
- // bugly project
- func updateProject(c *bm.Context) {
- var (
- req = &model.AddProjectRequest{}
- err error
- username string
- )
- if err = c.BindWith(req, binding.JSON); err != nil {
- return
- }
- if username, err = getUsername(c); err != nil {
- return
- }
- c.JSON(srv.UpdateBuglyProject(c, username, req))
- }
- func queryProjects(c *bm.Context) {
- var (
- req = &model.QueryBuglyProjectRequest{}
- err error
- )
- if err = req.Verify(); err != nil {
- c.JSON(nil, err)
- return
- }
- if err = c.BindWith(req, binding.JSON); err != nil {
- return
- }
- c.JSON(srv.QueryBuglyProjects(c, req))
- }
- func queryProjectVersions(c *bm.Context) {
- var (
- v = new(struct {
- ID int64 `form:"id"`
- })
- err error
- )
- if err = c.Bind(v); err != nil {
- return
- }
- c.JSON(srv.QueryBuglyProjectVersions(c, v.ID))
- }
- func queryProject(c *bm.Context) {
- var (
- v = new(struct {
- ID int64 `form:"id"`
- })
- err error
- )
- if err = c.Bind(v); err != nil {
- return
- }
- c.JSON(srv.QueryBuglyProject(c, v.ID))
- }
- func queryAllProjects(c *bm.Context) {
- c.JSON(srv.QueryAllBuglyProjects(c))
- }
- //test
- func test(c *bm.Context) {
- srv.BatchRunTask(model.TaskBatchRunUpdateBugInTapd, srv.BatchRunUpdateBugInTapd)
- c.JSON(nil, nil)
- }
|