param.go 245 B

123456789101112131415161718
  1. package apiserv
  2. import "strconv"
  3. type Param struct {
  4. Value string
  5. }
  6. func (p Param) Integer() int64 {
  7. if v, err := strconv.ParseInt(p.Value, 10, 64); err == nil {
  8. return v
  9. }
  10. return 0
  11. }
  12. func (p Param) String() string {
  13. return p.Value
  14. }