module . exports = { param ip subIp ( ip ) { const ips = ip . split ( '.' ) ; return `${ ips [ 0 ] }.${ ips [ 1 ] }.${ ips [ 2 ] }` ; } , param param0 param lowerRest capitalize ( [ first , ... rest ] , lowerRest = false ) { return first . toUpperCase ( ) + ( lowerRest ? rest . join ( '' ) . toLowerCase ( ) : rest . join ( '' ) ) ; } , param qs param eq param seq decode ( qs , eq = ' and ' , seq = '=' ) { const obj = { } ; if ( typeof qs !== 'string' || qs . length === 0 ) { return obj ; } qs . split ( eq ) . reduce ( ( previousValue , currentValue ) => { const [ key , value ] = currentValue . split ( seq ) ; previousValue [ key . trim ( ) ] = value . trim ( ) ; return previousValue ; } , obj ) ; return obj ; } , success ( res ) { this . ctx . body = { data : res , code : 200 , message : 'success' , success : true , } ; this . ctx . status = 200 ; } , } ;