File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -101,3 +101,19 @@ func NewHTTPRouter(
101101
102102 return mux
103103}
104+
105+
106+ func GetBoardNameHandler () http.HandlerFunc {
107+ return func (w http.ResponseWriter , r * http.Request ) {
108+ w .Header ().Set ("Content-Type" , "application/json" )
109+ // micro.GetBoardName() will be defined in internal/micro/micro.go as per plan
110+ name := micro .GetBoardName ()
111+ response := map [string ]string {"name" : name }
112+ if err := json .NewEncoder (w ).Encode (response ); err != nil {
113+ http .Error (w , "Failed to encode response: " + err .Error (), http .StatusInternalServerError )
114+ return
115+ }
116+ }
117+ }
118+
119+ mux .Handle ("GET /v1/system/name" , GetBoardNameHandler ())
Original file line number Diff line number Diff line change @@ -1669,3 +1669,24 @@ components:
16691669 version :
16701670 type : string
16711671 type : object
1672+
1673+
1674+ /v1/system/name :
1675+ get :
1676+ description : Returns the name of the board.
1677+ operationId : getBoardName
1678+ responses :
1679+ " 200 " :
1680+ content :
1681+ application/json :
1682+ schema :
1683+ properties :
1684+ name :
1685+ type : string
1686+ type : object
1687+ description : Successful response
1688+ " 500 " :
1689+ $ref : ' #/components/responses/InternalServerError'
1690+ summary : Get the board's name
1691+ tags :
1692+ - System
You can’t perform that action at this time.
0 commit comments