Stage 5 3. Micro Services [online] studies _day03 CMS page management development _04- new page - the server - Interface Development

api interface defines the method


The return type is CmsPageResult

CmsPageResult inherited ResponseResult

ResponseResult inside the three, SUCCESS, SUCCESS_CODE, message

to the new data in response to the client, the client may use

annotate swagger of

dao

dao which we do not have to write directly springDataMongoDB own save method on it. In succession to MongoReposityory

Service

First check the uniqueness of the page before the new

right-cmsPage this collection, create an index


path site id, page name, the page's




bottom right corner to create the index

is defined in the dao which is based on this query three fields. And to a splice between the field.



Failure and success of the return data


within the controller directly call the Service

converts data requests into a json object. Use @RequestBody

More Interface developed

Guess you like

Origin www.cnblogs.com/wangjunwei/p/11566860.html