Browse Source

mask不同天使用不同的编码规则

pull/4/head
欧醚 4 years ago
parent
commit
ca716e07ef
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      app/controllers/api/v1/statuses_controller.rb

+ 8
- 1
app/controllers/api/v1/statuses_controller.rb View File

@ -38,7 +38,14 @@ class Api::V1::StatusesController < Api::BaseController
end
def to_cn(n)
"甲乙丙丁戊己庚辛壬癸"[n % 10] + [n % 20873, n % 20899].map{|i| i+0x4e00}.pack('U*')
case Time.new.wday
when 0, 3
"秦汉魏晋隋唐宋元明清"[n % 10] + [n % 20873, n % 20899].map{|i| i+0x4e00}.pack('U*')
when 1, 4, 6
"甲乙丙丁戊己庚辛壬癸"[n % 10] + [n % 20873, n % 20899].map{|i| i+0x4e00}.pack('U*')
else
"鼠牛虎兔龙蛇马羊猴鸡狗猪" [n % 12] + [n % 20873, n % 20899].map{|i| i+0x4e00}.pack('U*')
end
end
def create

Loading…
Cancel
Save