23 lines
		
	
	
		
			444 B
		
	
	
	
		
			Go
		
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			444 B
		
	
	
	
		
			Go
		
	
	
	
package dataTemp
 | 
						|
 | 
						|
// RespPageBo 分页响应实体
 | 
						|
type RespPageBo struct {
 | 
						|
	Page  int   //页码
 | 
						|
	Limit int   //每页大小
 | 
						|
	Total int64 //总数
 | 
						|
}
 | 
						|
 | 
						|
// SetDataByReq 通过req 设置响应参数
 | 
						|
func (r *RespPageBo) SetDataByReq(total int64, reqPage *ReqPageBo) *RespPageBo {
 | 
						|
	resp := r
 | 
						|
	if r == nil {
 | 
						|
		resp = &RespPageBo{}
 | 
						|
	}
 | 
						|
	resp.Total = total
 | 
						|
	if reqPage != nil {
 | 
						|
		resp.Page = reqPage.Page
 | 
						|
		resp.Limit = reqPage.Limit
 | 
						|
	}
 | 
						|
	return resp
 | 
						|
}
 |